mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
modified blender action
This commit is contained in:
parent
f0918ec760
commit
2635268a49
1 changed files with 17 additions and 12 deletions
|
|
@ -24,19 +24,24 @@ class SelectInvalidAction(pyblish.api.Action):
|
||||||
if isinstance(invalid_nodes, (list, tuple)):
|
if isinstance(invalid_nodes, (list, tuple)):
|
||||||
invalid.extend(invalid_nodes)
|
invalid.extend(invalid_nodes)
|
||||||
else:
|
else:
|
||||||
self.log.warning("Failed plug-in doens't have any selectable objects.")
|
self.log.warning(
|
||||||
|
"Failed plug-in doens't have any selectable objects."
|
||||||
|
)
|
||||||
|
|
||||||
|
bpy.ops.object.select_all(action='DESELECT')
|
||||||
|
|
||||||
# Make sure every node is only processed once
|
# Make sure every node is only processed once
|
||||||
invalid = list(set(invalid))
|
invalid = list(set(invalid))
|
||||||
|
if not invalid:
|
||||||
bpy.ops.object.select_all(action='DESELECT')
|
|
||||||
if invalid:
|
|
||||||
invalid_names = [obj.name for obj in invalid]
|
|
||||||
self.log.info("Selecting invalid objects: %s", ", ".join(invalid_names))
|
|
||||||
# Select the objects and also make the last one the active object.
|
|
||||||
for obj in invalid:
|
|
||||||
obj.select_set(True)
|
|
||||||
bpy.context.view_layer.objects.active = invalid[-1]
|
|
||||||
|
|
||||||
else:
|
|
||||||
self.log.info("No invalid nodes found.")
|
self.log.info("No invalid nodes found.")
|
||||||
|
return
|
||||||
|
|
||||||
|
invalid_names = [obj.name for obj in invalid]
|
||||||
|
self.log.info(
|
||||||
|
"Selecting invalid objects: %s", ", ".join(invalid_names)
|
||||||
|
)
|
||||||
|
# Select the objects and also make the last one the active object.
|
||||||
|
for obj in invalid:
|
||||||
|
obj.select_set(True)
|
||||||
|
|
||||||
|
bpy.context.view_layer.objects.active = invalid[-1]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue