Animation: Motion Paths Refresh All

Adds a button, Update All Paths, to the Motion Paths property tabs and
will always show. The operator goes through all visible objects and
updates their motion paths.

The current implementation has a subtle functional change. Calculating
or updating motion paths for armature objects (through the Object tab,
not Armature tab) now also updates the paths for its bones. We could
preserve the old behavior but it doesn't seem necessary. It seems more
likely that the animator wants to update both anyways.

Reviewed by: sybren

Maniphest Tasks: T83068

Differential Revision: https://developer.blender.org/D11667
This commit is contained in:
Jan-Willem van Dronkelaar
2021-10-18 14:23:23 +02:00
committed by Sybren A. Stüvel
parent f9113c4be8
commit 4de0e2e771
7 changed files with 124 additions and 17 deletions

View File

@@ -68,20 +68,25 @@ class MotionPathButtonsPanel:
col.prop(mpath, "frame_start", text="Cache From")
col.prop(mpath, "frame_end", text="To")
row = layout.row(align=True)
col = layout.column(align=True)
row = col.row(align=True)
if bones:
row.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA')
row.operator("pose.paths_clear", text="", icon='X')
else:
row.operator("object.paths_update", text="Update Paths", icon='OBJECT_DATA')
row.operator("object.paths_clear", text="", icon='X')
col.operator("object.paths_update_visible", text="Update All Paths", icon="WORLD")
else:
col = layout.column(align=True)
col.label(text="Nothing to show yet...", icon='ERROR')
if bones:
col.operator("pose.paths_calculate", text="Calculate...", icon='BONE_DATA')
else:
col.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA')
col.operator("object.paths_update_visible", text="Update All Paths", icon="WORLD")
class MotionPathButtonsPanel_display:

View File

@@ -3601,6 +3601,8 @@ class VIEW3D_MT_pose_context_menu(Menu):
layout.operator("pose.paths_calculate", text="Calculate Motion Paths")
layout.operator("pose.paths_clear", text="Clear Motion Paths")
layout.operator("pose.paths_update", text="Update Armature Motion Paths")
layout.operator("object.paths_update_visible", text="Update All Motion Paths")
layout.separator()