Begin port to GPv3 - change GP type

This commit is contained in:
pullusb
2024-11-11 15:35:39 +01:00
parent 98ed92afe2
commit f5a78601b6
22 changed files with 96 additions and 96 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ class GPTB_OT_import_obj_palette(Operator):
def execute(self, context):
## get targets
selection = [o for o in context.selected_objects if o.type == 'GPENCIL']
selection = [o for o in context.selected_objects if o.type == 'GREASEPENCIL']
if not selection:
self.report({'ERROR'}, 'Need to have at least one GP object selected in scene')
return {"CANCELLED"}
@@ -98,7 +98,7 @@ class GPTB_OT_import_obj_palette(Operator):
return {"CANCELLED"}
for i in range(len(linked_objs))[::-1]: # reversed(range(len(l))) / range(len(l))[::-1]
if linked_objs[i].type != 'GPENCIL':
if linked_objs[i].type != 'GREASEPENCIL':
print(f'{linked_objs[i].name} type is "{linked_objs[i].type}"')
bpy.data.objects.remove(linked_objs.pop(i))