AnimCupboard: ID Management Pie #127

Merged
Demeter Dzadik merged 11 commits from Mets/blender-studio-pipeline:AnimCupboard-relationship-viewer into main 2023-07-19 14:43:14 +02:00
Showing only changes of commit 1a245cc7c2 - Show all commits

View File

@ -289,26 +289,11 @@ class OUTLINER_OT_remap_users(bpy.types.Operator):
)
def execute(self, context):
for area in context.screen.areas:
if area.type == 'VIEW_3D':
break
else:
self.report(
{'ERROR'}, "Error: This operation requires an Outliner to be present."
)
return {'CANCELLED'}
source_id = get_id(self.id_name_source, self.id_type, self.library_path_source)

This loop is looking for a VIEW_3D but the report says it is checking if an outliner is present. Assuming the outliner is what you are looking for wouldn't it be more explicit to do...

for area in context.screen.areas:
    if area.type == 'OUTLINER':
        break
else:
    self.report(
        {'ERROR'}, "Error: This operation requires an Outliner to be present."
    )
    return {'CANCELLED'}
This loop is looking for a `VIEW_3D` but the report says it is checking if an outliner is present. Assuming the outliner is what you are looking for wouldn't it be more explicit to do... ```python for area in context.screen.areas: if area.type == 'OUTLINER': break else: self.report( {'ERROR'}, "Error: This operation requires an Outliner to be present." ) return {'CANCELLED'} ```
target_id = get_id(self.id_name_target, self.id_type, self.library_path)
if not target_id:
self.report(
{'ERROR'},
f'Failed to find ID: {self.id_name_target}, {self.id_type}, lib: {self.library_path}',
)
return {'CANCELLED'}
assert source_id and target_id, "Error: Failed to find source or target."
source_id.user_remap(target_id)
return {'FINISHED'}