Skip to content

Commit

Permalink
Set the Rolling Shutter Content Distance parameter in 3DE4 R6+.
Browse files Browse the repository at this point in the history
Issue #128.
  • Loading branch information
david-cattermole committed Dec 5, 2020
1 parent 8a7b608 commit 43f5f68
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
5 changes: 1 addition & 4 deletions 3dequalizer/python/export_track_mmsolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ def main():
if rs_enabled is True:
rs_distance = tde4.getWidgetValue(req, 'rs_distance_widget')
rs_distance = float(rs_distance)
with_project_notes = uvtrack_format.SUPPORT_PROJECT_NOTES
with_rs_distance = uvtrack_format.SUPPORT_RS_DISTANCE
if with_project_notes is True and with_rs_distance is False:
uvtrack_format.set_rs_distance_into_project_notes(rs_distance)
uvtrack_format.set_rs_distance(camera, rs_distance)

# Generate file contents
data_str = uvtrack_format.generate(
Expand Down
13 changes: 13 additions & 0 deletions 3dequalizer/python/uvtrack_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def set_rs_distance_into_project_notes(rs_distance):

def get_rs_distance(camera):
if SUPPORT_RS_DISTANCE is True:
# For 3DE4 Release 6 and above.
rs_distance = tde4.getCameraRollingShutterContentDistance(camera)
else:
# For 3DE4 Release 5 and below, use the default content
Expand All @@ -156,6 +157,18 @@ def get_rs_distance(camera):
return rs_distance


def set_rs_distance(camera, rs_distance):
assert isinstance(rs_distance, float)
if SUPPORT_RS_DISTANCE is True:
# For 3DE4 Release 6 and above.
tde4.setCameraRollingShutterContentDistance(camera, rs_distance)
elif SUPPORT_PROJECT_NOTES is True:
# For 3DE4 Release 2 to Release 5 (with support for project
# notes), set a special tag in the 3DE project notes.
set_rs_distance_into_project_notes(rs_distance)
return


def _apply_rs_correction(dt, q_minus, q_center, q_plus):
"""
Apply time-blend between three different 3D positions.
Expand Down
18 changes: 14 additions & 4 deletions 3dequalizer/scriptdb/export_track_mmsolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ def main():
if rs_enabled is True:
rs_distance = tde4.getWidgetValue(req, 'rs_distance_widget')
rs_distance = float(rs_distance)
with_project_notes = SUPPORT_PROJECT_NOTES
with_rs_distance = SUPPORT_RS_DISTANCE
if with_project_notes is True and with_rs_distance is False:
set_rs_distance_into_project_notes(rs_distance)
set_rs_distance(camera, rs_distance)

# Generate file contents
data_str = generate(
Expand Down Expand Up @@ -247,6 +244,7 @@ def set_rs_distance_into_project_notes(rs_distance):

def get_rs_distance(camera):
if SUPPORT_RS_DISTANCE is True:
# For 3DE4 Release 6 and above.
rs_distance = tde4.getCameraRollingShutterContentDistance(camera)
else:
# For 3DE4 Release 5 and below, use the default content
Expand All @@ -258,6 +256,18 @@ def get_rs_distance(camera):
return rs_distance


def set_rs_distance(camera, rs_distance):
assert isinstance(rs_distance, float)
if SUPPORT_RS_DISTANCE is True:
# For 3DE4 Release 6 and above.
tde4.setCameraRollingShutterContentDistance(camera, rs_distance)
elif SUPPORT_PROJECT_NOTES is True:
# For 3DE4 Release 2 to Release 5 (with support for project
# notes), set a special tag in the 3DE project notes.
set_rs_distance_into_project_notes(rs_distance)
return


def _apply_rs_correction(dt, q_minus, q_center, q_plus):
"""
Apply time-blend between three different 3D positions.
Expand Down

0 comments on commit 43f5f68

Please sign in to comment.