Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions movie_clip_editor_panorama_tracker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def calculate_orientation(scene):
if not movieclip: return (0,0,0)

settings = movieclip.panorama_settings

set_horizon = settings.set_horizon
tracking = movieclip.tracking.objects[movieclip.tracking.active_object_index]
focus = tracking.tracks.get(settings.focus)
target = tracking.tracks.get(settings.target)
Expand All @@ -207,11 +207,11 @@ def calculate_orientation(scene):
# retarget y axis again
nvecy = vecz.cross(vecx)
nvecy.normalize()

# store orientation
orientation = sphere_to_euler(vecx, nvecy, vecz)
orientation = (settings.orientation.to_matrix() * orientation.to_matrix()).to_euler()

if set_horizon == False:
orientation = (settings.orientation.to_matrix() * orientation.to_matrix()).to_euler()
return (-orientation[0], -orientation[1], -orientation[2])


Expand Down Expand Up @@ -470,6 +470,7 @@ def update_panorama_orientation(scene):
tex_env.texture_mapping.rotation = mapping_node_order_flip(orientation)



def mapping_node_order_flip(orientation):
"""
Flip euler order of mapping shader node
Expand All @@ -491,6 +492,7 @@ class TrackingPanoramaSettings(bpy.types.PropertyGroup):
target = StringProperty()
flip = BoolProperty(default=True)
show_preview = BoolProperty(default=False, name="Show Preview", update=show_preview_update)
set_horizon = BoolProperty(default=False, name="Set horizon")


# ###############################
Expand Down
4 changes: 3 additions & 1 deletion movie_clip_editor_panorama_tracker/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def draw(self, context):
col.separator()
col.prop(settings, "show_preview")

col.separator()
col.prop(settings, "set_horizon")

# ###############################
# Register / Unregister
Expand All @@ -61,4 +63,4 @@ def register():


def unregister():
bpy.utils.unregister_class(CLIP_PanoramaPanel)
bpy.utils.unregister_class(CLIP_PanoramaPanel)