st"> nd"> rd"> cm"> sec"> unit"> degree"> vec"> vec1d"> vec2d"> vec3d"> vec4d"> mat"> mat1d"> mat2d"> mat3d"> mat4d"> igl"> igl1d"> igl2d"> igl3d"> igl4d"> quatd"> rot2d"> rot3d"> 3DE4"> 3DE4/r4b1"> 3DE4/r4b2"> 3DE4/r4b3"> 3DE4/r4b4"> tde4mhpd"> 3DE4/MHP"> MHP"> VL"> Main Window"> Overview Controls"> Manual Tracking Controls"> Distortion Grid Controls"> Autotracking Controls"> Lineup Controls"> 3D Orientation Controls"> F1"> F2"> F3"> F4"> F5"> F6"> Windows"> Calc"> Python"> Adjustment"> Object Browser"> Deviation Browser"> Timeline Editor"> Curve Editor"> Attribute Editor"> Parameter Adjustment Window"> Advanced Options"> Network Calc"> Image Controls Window"> Python Console Window"> Online Help Window"> Preferences"> Network Calculation"> Network Calculation Mode"> Enabled - Static Master Node"> Enabled - Dynamic Self Organizing Network"> Off"> Master Node Hostname"> Allow For Network Calculation"> Frame Range Calculation"> Run Python Script..."> Rescan Python Directories"> Open Python Console..."> Project"> Camera"> Camera"> Weight"> Live Action Footage"> First Frame is Frame"> Lens"> Lens..."> Focal Length"> Use From Lens"> Static"> Dynamic"> Focus Distance"> Rolling Shutter Compensation"> Synchronization"> Stereoscopic"> Orientation"> Lefthand Camera"> Righthand Camera"> Timeshift"> Point Group"> Point"> Point"> Position XYZ"> 2D Tracking"> 3D Calculation"> Survey Type"> Survey Free"> Approximately Surveyed"> Exactly Surveyed"> Lineup Only Surveyed"> Approx. Survey Radius"> 3D Model"> Lens"> Lens Distortion"> Dynamic Lens Distortion"> Scene"> Cameras"> Point Groups"> Constraints"> Lenses"> blob"> core"> gui script"> gui scripts"> modifier script"> modifier scripts"> parent"> responder"> computational"> news"> updater_udp"> scanner"> deputy"> self"> float"> complex"> len"> __repr__"> __str__"> +"> −"> *"> /"> +="> −="> *="> /="> dotsq"> dot"> tensq"> ten"> wdg"> norm1"> norm2"> norminf"> unit"> para"> ortho"> dual"> invert"> conjugate"> quat"> axis"> angle"> angles"> trans"> trace"> sub"> adj"> det"> invert"> 3DE4"> ||"> a"> b"> p"> u"> pl"> ul"> ml"> pr"> ur"> mr"> p' r"> cl,x"> cl,y"> cl,z"> cr,x"> cr,y"> cr,z"> c' r,z"> ccenter"> ex"> ey"> ez"> ddepth"> dvert"> dioc"> pconv"> 1"> R3"> ⊥&u;"> ⊥&u_l;"> ⊥&u_r;"> ⊥stereo"> ⊥center"> Attribute Editor"> Cameras"> Stereoscopic"> Rotation Policy"> rotation policy"> rotation policies"> Allow y-Rotation Only"> Allow Rotation Around all Axes"> parallaxe"> interocular"> Interocular"> Curve Editor"> vertical shift"> Vertical Shift"> depth shift"> Calc"> Zoom Curve"> Calc Zoom Curve From Scratch"> Finetune Zoom Curve From Scratch"> w"> wa"> wb"> wr"> h"> ha"> hb"> hr"> gles::math"> imgop"> imgop_ldpk"> imgop_pthread"> ldpk"> transwarp"> minifl"> img"> img_memptr"> int"> true"> false"> float"> n"> selector"> segment"> collect/apply"> ]>
Document version | &tde4; Release | Document published | Changes |
2 | &tde4r4b3; | unpublished | Minor changes, renamed to "Adjustment Scripting" |
1 | &tde4r4b3; | 2014-11-18 | First release |
tde4.createParameterAdjustScript(<script>,<par_name>,<custom_pars>,<range_from>,<range_to>).
<double> tde4.getParameterAdjustCurrentValue() <string> tde4.getParameterAdjustCustomParameters() <0|1> tde4.getParameterAdjustPhaseRunningFlag() tde4.applyParameterAdjustDataModification(<selector_string>,<double>)
<0|1> tde4.getParameterAdjustPhaseRunningFlag()
tde4.getParameterAdjustCurrentValue()
<string> tde4.getParameterAdjustCustomParameters().
tde4.applyParameterAdjustDataModification(selector,value)
tde4.getParameterAdjustCurrentValue()
adjust_distortion_vertices_gui.py
adjust_distortion_vertices.py
# 3DE4.script.name: Adjust Distortion Vertices... # 3DE4.script.version: v0.5 (demo) # 3DE4.script.gui: Main Window::Adjustment # # 3DE4.script.comment: Add all selected vertices to parameter adjustment window # 3DE4.script.comment: in order to adjust their value. All vertices must be set to "LINEAR" import os import string # exceptions class key_is_not_linear(BaseException): pass
# main function def adj_dist_vert_main(): # Current camera and lens id_cam = tde4.getCurrentCamera() id_lens = tde4.getCameraLens(id_cam) # Get lens distortion model of current lens model = tde4.getLensLDModel(id_lens) num_par = tde4.getLDModelNoParameters(model)
# Location of adjustment script. In this case it's in my home directory. script = os.getenv("HOME") + "/.3dequalizer/py_scripts/adjust_distortion_vertices.py"
# Run through parameters and get the curve. ids_key = [] for i in range(num_par): name_par = tde4.getLDModelParameterName(model,i) id_curve = tde4.getLensLDAdjustableParameterCurve(id_lens,name_par) # Run through selected vertices for this curve for id_key in tde4.getCurveKeyList(id_curve,True): mode = tde4.getCurveKeyMode(id_curve,id_key) if mode != "LINEAR": raise key_is_not_linear() value = tde4.getCurveKeyPosition(id_curve,id_key) # In r4b3 parameter names must be unique. We encode the x-position # and the curve identifier in the parameter name. As of r4b4 this won't # be required any more, and a simple name will do. But for now: par_name = "Vertex at %f in curve '%s'" % (value[0],name_par)
# Tell the modifier script what to modify custom_pars = id_curve + " " + id_key # Range. This is a demo script. In practice it would be nice to enter them in a GUI. range_from,range_to = -0.05,+0.05 # Now create the parameter entry: tde4.createParameterAdjustScript(script,par_name,custom_pars,range_from,range_to) try: adj_dist_vert_main() except(key_is_not_linear): print "For this script, all selected vertices must be set to mode 'LINEAR'." print "See Curve Editor->Edit->Set CVs to->Linear"
# 3DE4.script.hide: true
running = tde4.getParameterAdjustPhaseRunningFlag() paras = tde4.getParameterAdjustCustomParameters() id_curve,id_key = paras.split()
# During adjustment, this is the value currently used by core. # After adjustment, it's the best value found during adjustment. value = tde4.getParameterAdjustCurrentValue() # adjustment is running if running == 1: # We build the selector. An ID is marked by a leading '@'. mod = "@%s.py" % id_key px,py = tde4.getCurveKeyPosition(id_curve,id_key) tde4.applyParameterAdjustDataModification(mod,py + value)
# adjustment is done, now copy best results back into 3DE's database... if running == 0: # We won't change the x-coordinate of the vertex, only the y-value. px,py = tde4.getCurveKeyPosition(id_curve,id_key) tde4.setCurveKeyPosition(id_curve,id_key,[px,py + value])
tde4.applyParameterAdjustDataModification(selector,value)
project.lenses.@abcd1234.lens_distortion_model.pars.5.curve.vertices.@4321dcba.py
@4321dcba.py
common.head.of.selectors | Comments | |
.example.tail.of.selector | type | Comments |
tde4.exampleRelatedPythonCommand(...) | ||
.another.tail.of.selector | type | Comments |
tde4.anotherRelatedPythonCommand(...) |
common.head.of.selectors.example.tail.of.selector common.head.of.selectors.another.tail.of.selector
project.cameras.&dbid;.constraints | Selectors related to camera constraints, e.g. line constraints, plane constraints, locked channel constraints | |
.frame.<index>.position_3d | vec3d | Camera position for locked channel constraints. <index> starts at 1 (convenience selector). |
tde4.setPGroupPosition3D(pgroup_id,camera_id,frame,vec3d) | ||
.position.enforce_y_value | num | y-value for plane constraints |
No command available | ||
.rotation.z_roll | num | Constant z-roll angle for angular constraints |
No command available | ||
project.cameras.&dbid;.focal | Selectors related to camera-based focal length | |
.focal.curve.vertices.&dbid;.px | num | The curve maps frames into focal length values. See |
tde4.getCameraZoomCurve(camera_id) tde4.setCurveKeyPosition(curve_id,key_id,vec2d) tde4.setCurveKeyTangent1(curve_id,key_id,vec2d) tde4.setCurveKeyTangent2(curve_id,key_id,vec2d) | ||
.focal.curve.vertices.&dbid;.py | num | Frame dependent focal length in &cm; |
.focal.curve.vertices.&dbid;.t1x | num | Left tangent vector x |
.focal.curve.vertices.&dbid;.t1y | num | Left tangent vector y |
.focal.curve.vertices.&dbid;.t2x | num | Right tangent vector x |
.focal.curve.vertices.&dbid;.t2y | num | Right tangent vector y |
.focal.value_cm | num | Static value, associated to camera, see &attribute_editor;&guiarr;&tab_camera;&guiarr;§ion_lens;&guiarr;&entry_focal_length; |
tde4.setCameraFocalLength(camera_id,frame,value) | ||
project.cameras.&dbid;.focus | Selectors related to camera-based focus distance | |
.focus.curve.vertices.&dbid;.px | num | The curve maps frames into focus distance values. See |
tde4.getCameraFocusCurve(camera_id) tde4.setCurveKeyPosition(curve_id,key_id,vec2d) tde4.setCurveKeyTangent1(curve_id,key_id,vec2d) tde4.setCurveKeyTangent2(curve_id,key_id,vec2d) | ||
.focus.curve.vertices.&dbid;.py | num | Focus Distance in &cm; |
.focus.curve.vertices.&dbid;.t1x | num | Left tangent vector x |
.focus.curve.vertices.&dbid;.t1y | num | Left tangent vector y |
.focus.curve.vertices.&dbid;.t2x | num | Right tangent vector x |
.focus.curve.vertices.&dbid;.t2y | num | Right tangent vector y |
.focus.value_cm | num | Static value, associated to camera, see &attribute_editor;&guiarr;&tab_camera;&guiarr;§ion_lens;&guiarr;&entry_focus_distance; |
tde4.setCameraFocus(camera_id,frame,value) | ||
project.cameras.&dbid; | Various camera selectors | |
.footage.frame_rate | num | Frame rate in frames per second |
tde4.setCameraFPS(camera_id,value) | ||
.fov.xa | num | Field of View, left edge, in &unit; coordinates with respect to the image. |
tde4setCameraFOV(camera_id,xa,xb,ya,yb) | ||
.fov.xb | num | Field of View, right edge |
.fov.ya | num | Field of View, bottom edge |
.fov.yb | num | Field of View, top edge |
.rolling_shutter.timeshift | num | Rolling shutter timeshift in &sec;, see &attribute_editor;&guiarr;&tab_camera;&guiarr;§ion_rolling_shutter_compensation; |
tde4.setCameraRollingShutterTimeShift(camera_id,value) | ||
.sync.timeshift | num | Timeshift in frames for synchronized cameras, see &attribute_editor;&guiarr;&tab_camera;&guiarr;§ion_synchronization;&guiarr;&entry_timeshift; |
tde4.setCameraSyncTimeshift(camera_id,value) | ||
.weight | num | Weight factor, impact of the camera on point groups, see &attribute_editor;&guiarr;&tab_camera;&guiarr;§ion_camera;&guiarr;&entry_weight; |
tde4.setCameraWeight(camera_id,value) | ||
project.cameras.&dbid;.stereo | The following selectors address data elements in the &blob; which are related to stereo. Please note, that in the &blob; stereo related data are strictly associated to the secondary camera (while in &tde4;'s GUI they are associated to the primary camera). In the &blob; the primary camera determines a coordinate system and the secondary camera is displaced by a 3d-vector relative to the primary camera. The relationship between the two cameras is described in our document about stereoscopic matchmoving. | |
.interocular.curve.vertices.&dbid;.px | num | The interocular curve maps frames into interocular distances. See |
tde4.getCameraStereoInterocularCurve(camera_id) tde4.setCurveKeyPosition(curve_id,key_id,vec2d) tde4.setCurveKeyTangent1(curve_id,key_id,vec2d) tde4.setCurveKeyTangent2(curve_id,key_id,vec2d) | ||
.interocular.curve.vertices.&dbid;.py | num | Interocular distance in &cm; |
.interocular.curve.vertices.&dbid;.t1x | num | Left tangent vector x |
.interocular.curve.vertices.&dbid;.t1y | num | Left tangent vector y |
.interocular.curve.vertices.&dbid;.t2x | num | Right tangent vector x |
.interocular.curve.vertices.&dbid;.t2y | num | Right tangent vector y |
.interocular.value_cm | num | Static interocular in &cm; |
tde4.setCameraStereoInterocular(camera_id,value) | ||
.depth_shift.value_cm | num | Static depth shift in &cm; |
tde4.setCameraStereoStaticDepthShift(camera_id,value) | ||
.vertical_shift.value_cm | num | Static vertical shift in &cm; |
tde4.setCameraStereoStaticVerticalShift(camera_id,value) |
project.lenses.&dbid; | The following selectors address lens properties. They can be used in &modifier_scripts; but it's tricky. Do not try this unless you fully understand the relationship between these parameters. In &tde4;'s &attribute_editor; you see that all parameters are already equipped with adjust buttons, so in most situations &tde4;'s capabilities for these parameters should be sufficient. See &attribute_editor;&guiarr;&tab_lens;. | |
.film_aspect | num | Film aspect is filmback width divided by filmback height. |
tde4.setLensFilmAspect(lens_id,value) | ||
.film_back_width_cm | num | Filmback width in &cm;. The filmback is the area of the camera projection plane which corresponds to the area in the footage marked by the field of view lines in &overview_controls; (&F1;) and &manual_tracking_controls; (&F2;) |
tde4.setLensFBackWidth(lens_id,value) | ||
.film_back_height_cm | num | Filmback height in &cm; |
tde4.setLensFBackWidth(lens_id,value) | ||
.pixel_aspect | num | Pixel aspect ratio. |
tde4.setLensPixelAspect(lens_id,value) | ||
project.lenses.&dbid; | The following selectors are not quite as tricky as the previous ones. Feel free to use them in your scripts. | |
.focal_length_cm | num | Static lens-based focal length in &cm;. |
tde4.setLensFocalLength(lens_id,value) | ||
.focus_distance_cm | num | Static lens-based focus distance in &cm;. |
tde4.setLensFocus(lens_id,value) | ||
.lco_x_cm | num | Lens center offset x in &cm; |
tde4.setLensLensCenterX(lens_id,value) | ||
.lco_y_cm | num | Lens center offset y in &cm; |
tde4.setLensLensCenterY(lens_id,value) | ||
project.lenses.&dbid;.lens_distortion_model | The following selectors control static and dynamic lens distortion. The adjustable parameters of each lens distortion model are numbered by an index starting at 0. We are using this index notation here as opposed to addressing parameters directly by name since otherwise the selector syntax would explicitly depend on the lens distortion model, which is not possible given the fact that lens distortion models can be plugins. &tde4;'s python interface has a function to determine the index from the parameter name. | |
.pars.<index>.curve.vertices.&dbid;.px | num | The curve maps from either focal length or focus distance onto the parameter value,
see &attribute_editor;&guiarr;&tab_lens;&guiarr;§ion_lens_distortion;&guiarr;&entry_dynamic_lens_distortion;.
In both cases the x-value is given in &cm;. See |
tde4.getLensLDAdjustableParameterCurve(lens_id,para_name) tde4.setCurveKeyPosition(curve_id,key_id,vec2d) tde4.setCurveKeyTangent1(curve_id,key_id,vec2d) tde4.setCurveKeyTangent2(curve_id,key_id,vec2d) | ||
.pars.<index>.curve.vertices.&dbid;.py | num | The dynamic parameter value. |
.pars.<index>.curve.vertices.&dbid;.t1x | num | Left tangent vector x |
.pars.<index>.curve.vertices.&dbid;.t1y | num | Left tangent vector y |
.pars.<index>.curve.vertices.&dbid;.t2x | num | Right tangent vector x |
.pars.<index>.curve.vertices.&dbid;.t2y | num | Right tangent vector y |
project.lenses.&dbid;.lens_distortion_model | As of &tde4r4b3; lens parameters may be driven by both focal length and focus distance, see &attribute_editor;&guiarr;&tab_lens;&guiarr;§ion_lens_distortion;&guiarr;&entry_dynamic_lens_distortion;. As a consequence, the surface functions which map focal length and focus distance to lens distortion for each parameter have to be transferred from &tde4;'s database to the &core;. The selectors here allow access to this function. | |
.pars.<index>.surface.vertices.<index>.f | num | The function value mapped to from focal length and focus distance. |
tde4.getLensNo2DLUTSamples(lens_id,para_name) tde4.setLens2DLUTSample (lens_id,para_name,index,focal,focus,value) | ||
.pars.<index>.surface.vertices.<index>.x | num | Focal length in &cm; |
.pars.<index>.surface.vertices.<index>.y | num | Focus distance in &cm; |
project.lenses.&dbid;.lens_distortion_model | If lens distortion is not dynamic at all, the following selector is relevant. | |
.pars.<index>.value.d | num | Static distortion value |
tde4.setLensLDAdjustableParameter (lens_id,para_name,focal,focus,value) |
project.pgroups.&dbid;.constraints | &tde4r4b3; supports a number of point constraints, namely distance constraints and position constraints. Distance constraints appear as objects in &object_browser;&guiarr;&expand_scene;&guiarr;&expand_point_groups;&guiarr;&expand_constraints;. Position constraints appear in &attribute_editor;&guiarr;&tab_point;&guiarr;&entry_position_xyz; as toggle buttons beside the point coordinate text fields. | |
.distance_constraints.&dbid;.distance | num | As of &tde4r4b3; distance constraints are objects in the database, which have an id like cameras and lenses. This selector addresses the distance constraint specified by &dbid;. |
tde4.setDConstrDistance(pgroup_id,dconstr_id,value) | ||
.position_constraints.&dbid;.radius | num | See |
tde4.setPointApproxSurveyRange(pgroup_id,point_id,value) | ||
project.pgroups.&dbid;.points.&dbid;.blending | Blending parameters control the impact of the tracking data on the triangulation of points. | |
.position.x | num | Size of positional blending zone in x-direction in unit coordinates. The point weight increases from 0 at the left or right image edge to 1 at the vertical lines defined by this value. |
tde4.setPointPositionWeightBlending (pgroup_id,point_id,horizontal,vertical) | ||
.position.y | num | Size of positional blending zone in y-direction in unit coordinates. The point weight increases from 0 at the bottom or top image edge to 1 at the horizontal lines defined by this value. |
tde4.setPointPositionWeightBlending (pgroup_id,point_id,horizontal,vertical) | ||
project.pgroups.&dbid;.points.&dbid;.cameras.&dbid; | The following selector is a "convenience selectors". It encapsulates a more complicated selector which reflects the structure of tracking data as e.g. in &tde4;'s &timeline_editor;. This structure would make it absurdly complicated to address tracking data in the &blob;, therefore we have this simplified version. The <index> starts at 1 for the first frame, as in &tde4;'s GUI. Tracking positions are given in normalized image coordinates, from (0,0) in the lower left corner of the lower left pixel to (1,1) in the upper right corner of the upper right pixel. | |
.frame.<index>.position_2d | vec2d | Tracking position in &unit; coordinates |
tde4.setPointPosition2D (pgroup_id,point_id,camera_id,frame,vec2d) | ||
project.pgroups.&dbid;.points.&dbid;.mocap | ||
.filter.position_cutoff | num | Mocap points have a time-dependent position which is subject to filtering. This parameters controls the filter strength. |
setPointMocapZDepthFilter(pgroup_id,point_id,value | ||
.frame.<index>.position_3d | vec3d | In motion capturing point groups the positions can be pre-defined, like survey data. <index> starts at 1 (convenience selector). |
tde4.setPointMoCapSurveyPosition3D (pgroup_id,point_id,camera_id,frame,vec3d) | ||
project.pgroups.&dbid;.points.&dbid; | ||
.position_3d | vec3d | If the point is exactly survey, this is the position. |
tde4.setPointSurveyPosition3D(pgroup_id,point_id,vec3d) | ||
.weight | num | The weight factor specifies the impact of the point on the cameras. |
tde4.setPointWeight(pgroup_id,point_id,value) |
# 3DE4.script.name: Adjust I/O Curve Scale & Offset (primary right)... # 3DE4.script.version: v1.1 # 3DE4.script.gui: Main Window::Adjustment # 3DE4.script.comment: Add scale and offset parameters to 3DE's parameter # 3DE4.script.comment: adjustment window for optimizing # 3DE4.script.comment: interocular distance curve of a stereo project. import os # find primary & secondary stereo camera... id_cam_prim = None id_cam_sec = None ids_cam = tde4.getCameraList() for id_cam in ids_cam: mode = tde4.getCameraStereoMode(id_cam) if mode == "STEREO_PRIMARY": id_cam_prim = id_cam if mode == "STEREO_SECONDARY": id_cam_sec = id_cam
if id_cam_prim == None or id_cam_sec == None: # Not a stereo project tde4.postQuestionRequester("Adjust I/O Curve Scale & Offset...","Primary stereo camera not found.","Ok") else: # This is a stereo project. Go ahead and build a GUI. req = tde4.createCustomRequester() tde4.addToggleWidget(req,"scale_toggle","Adjust I/O Curve Scale",0) tde4.addTextFieldWidget(req,"scale_field","Scale Range","0.9 1.1") tde4.addToggleWidget(req,"offset_toggle","Adjust I/O Curve Offset",0) tde4.addTextFieldWidget(req,"offset_field","Offset Range (cm)","-1.0 1.0") # Check for Button 1, "Ok" if tde4.postCustomRequester(req,"Adjust I/O Curve Scale & Offset...",600,0,"Ok","Cancel") == 1: # I'm testing this in my home directory path = os.getenv("HOME") script = path + "/.3dequalizer/py_scripts/adjust_io_scale_offset.py" # Extract range values from GUI sr0,sr1 = tde4.getWidgetValue(req,"scale_field").split() or0,or1 = tde4.getWidgetValue(req,"offset_field").split() # Extract adjust flags from GUI scale = tde4.getWidgetValue(req,"scale_toggle") offset = tde4.getWidgetValue(req,"offset_toggle")
# We pass the camera names to the modifier script. name_cam_prim = tde4.getCameraName(id_cam_prim) name_cam_sec = tde4.getCameraName(id_cam_sec) # These are the global variables used by the parameter entries # where we collect values from per-entry execution of modifier scripts. # We initialize them here, so we don't ever have to worry elsewhere, _adjust_io_curve_scale = 1.0 _adjust_io_curve_offset = 0.0 # As custom parameters we pass: # 1. The parameter to insert (scale,offset) # 2. The mode (collect/apply) # 3. The two camera names if scale: if offset==1: custom_pars = "scale collect " + name_cam_prim + " " + name_cam_sec else: custom_pars = "scale apply " + name_cam_prim + " " + name_cam_sec tde4.createParameterAdjustScript(script,"I/O Curve Scale",custom_pars,float(sr0),float(sr1)) if offset: custom_pars = "offset apply " + name_cam_prim + " " + name_cam_sec tde4.createParameterAdjustScript(script,"I/O Curve Offset",custom_pars,float(or0),float(or1))
# 3DE4.script.hide: true running = tde4.getParameterAdjustPhaseRunningFlag() value = tde4.getParameterAdjustCurrentValue() para = tde4.getParameterAdjustCustomParameters().split()
# For each parameter the script passes its value to one # of the global variables. We do this for both, the "collect" # and the "apply" pass. if para[0] == "scale": _adjust_io_curve_scale = value if para[0] == "offset": _adjust_io_curve_offset = value
if para[1] == "apply": # create io curve modification ("apply")... if running == 1: # interocular is associated to primary camera in 3DE4's database. id_cam_prim = tde4.findCameraByName(para[2]) # retrieve the previously collected scale & offset parameters scale = _adjust_io_curve_scale offset = _adjust_io_curve_offset id_crv = tde4.getCameraStereoInterocularCurve(id_cam_prim) ids_key = tde4.getCurveKeyList(id_crv,0) for id_key in ids_key: pos = tde4.getCurveKeyPosition(id_crv,id_key) t1d = tde4.getCurveKeyTangent1(id_crv,id_key) t2d = tde4.getCurveKeyTangent2(id_crv,id_key)
tde4.applyParameterAdjustDataModification("@%s.py" % id_key,pos[1] * scale + offset) tde4.applyParameterAdjustDataModification("@%s.t1y" % id_key,t1d[1] * scale) tde4.applyParameterAdjustDataModification("@%s.t2y" % id_key,t2d[1] * scale)
# copy best results back into 3DE's database... if running == 0: # interocular is associated to primary camera in 3DE4's database. id_cam_prim = tde4.findCameraByName(para[2]) # retrieve scale & offset parameters... scale = _adjust_io_curve_scale offset = _adjust_io_curve_offset id_crv = tde4.getCameraStereoInterocularCurve(id_cam_prim) ids_key = tde4.getCurveKeyList(id_crv,0) for id_key in ids_key: pos = tde4.getCurveKeyPosition(id_crv,id_key) t1d = tde4.getCurveKeyTangent1(id_crv,id_key) t2d = tde4.getCurveKeyTangent2(id_crv,id_key)
tde4.setCurveKeyPosition(id_crv,id_key,[pos[0],pos[1] * scale + offset]) tde4.setCurveKeyTangent1(id_crv,id_key,[t1d[0],t1d[1] * scale]) tde4.setCurveKeyTangent2(id_crv,id_key,[t2d[0],t2d[1] * scale]) # "apply" pass: reset global variables to default values... _adjust_io_curve_scale = 1.0 _adjust_io_curve_offset = 0.0
project...curve.vertices.&dbid;.px project...curve.vertices.&dbid;.py project...curve.vertices.&dbid;.t1x project...curve.vertices.&dbid;.t1y project...curve.vertices.&dbid;.t2x project...curve.vertices.&dbid;.t2yHere,
scale = _adjust_io_curve_scale offset = _adjust_io_curve_offset
if tde4.getCameraStereoOrientation(prcam) == "STEREO_RIGHT": scale = -_adjust_io_curve_scale offset = -_adjust_io_curve_offset else: scale = _adjust_io_curve_scale offset = _adjust_io_curve_offset
project.pgroups.<id>.points.<id_point>.position_3d[2]
project.pgroups.<id>.points.<id_point>.position_3d[1]
project.pgroups.<id>.points.<id_point>.position_3d[0] project.pgroups.<id>.points.<id_point>.position_3d[1] project.pgroups.<id>.points.<id_point>.position_3d[2] project.pgroups.<id>.constraints.position_constraints.<id_point>.radius