Begin port to GPv3 - change GP type
This commit is contained in:
+13
-13
@@ -79,7 +79,7 @@ class GPTB_OT_rename_data_from_obj(Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.object and context.object.type == 'GPENCIL'
|
||||
return context.object and context.object.type == 'GREASEPENCIL'
|
||||
|
||||
def execute(self, context):
|
||||
if not self.rename_all:
|
||||
@@ -93,7 +93,7 @@ class GPTB_OT_rename_data_from_obj(Operator):
|
||||
else:
|
||||
oblist = []
|
||||
for o in context.scene.objects:
|
||||
if o.type == 'GPENCIL':
|
||||
if o.type == 'GREASEPENCIL':
|
||||
if o.name == o.data.name:
|
||||
continue
|
||||
oblist.append(f'{o.data.name} -> {o.name}')
|
||||
@@ -250,7 +250,7 @@ class GPTB_OT_draw_cam(Operator):
|
||||
drawcam.parent = act
|
||||
vec = Vector((0,1,0))
|
||||
|
||||
if act.type == 'GPENCIL':
|
||||
if act.type == 'GREASEPENCIL':
|
||||
#change vector according to alignement
|
||||
vec = get_gp_alignement_vector(context)
|
||||
|
||||
@@ -427,15 +427,15 @@ class GPTB_OT_toggle_mute_animation(Operator):
|
||||
pool = context.scene.objects
|
||||
|
||||
for o in pool:
|
||||
if self.mode == 'GPENCIL' and o.type != 'GPENCIL':
|
||||
if self.mode == 'GREASEPENCIL' and o.type != 'GREASEPENCIL':
|
||||
continue
|
||||
if self.mode == 'OBJECT' and o.type in ('GPENCIL', 'CAMERA'):
|
||||
if self.mode == 'OBJECT' and o.type in ('GREASEPENCIL', 'CAMERA'):
|
||||
continue
|
||||
if self.mode == 'CAMERA' and o.type != 'CAMERA':
|
||||
continue
|
||||
|
||||
# mute attribute animation for GP and cameras
|
||||
if o.type in ('GPENCIL', 'CAMERA') and o.data.animation_data:
|
||||
if o.type in ('GREASEPENCIL', 'CAMERA') and o.data.animation_data:
|
||||
gp_act = o.data.animation_data.action
|
||||
if gp_act:
|
||||
print(f'\n---{o.name} data:')
|
||||
@@ -473,7 +473,7 @@ class GPTB_OT_toggle_hide_gp_modifier(Operator):
|
||||
else:
|
||||
pool = context.scene.objects
|
||||
for o in pool:
|
||||
if o.type != 'GPENCIL':
|
||||
if o.type != 'GREASEPENCIL':
|
||||
continue
|
||||
for m in o.grease_pencil_modifiers:
|
||||
# skip modifier that are not visible in render
|
||||
@@ -506,12 +506,12 @@ class GPTB_OT_list_disabled_anims(Operator):
|
||||
pool = context.scene.objects
|
||||
|
||||
for o in pool:
|
||||
# if self.skip_gp and o.type == 'GPENCIL':
|
||||
# if self.skip_gp and o.type == 'GREASEPENCIL':
|
||||
# continue
|
||||
# if self.skip_obj and o.type != 'GPENCIL':
|
||||
# if self.skip_obj and o.type != 'GREASEPENCIL':
|
||||
# continue
|
||||
|
||||
if o.type == 'GPENCIL':
|
||||
if o.type == 'GREASEPENCIL':
|
||||
if o.data.animation_data:
|
||||
gp_act = o.data.animation_data.action
|
||||
if gp_act:
|
||||
@@ -611,7 +611,7 @@ class GPTB_OT_clear_active_frame(Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.object and context.object.type == 'GPENCIL'
|
||||
return context.object and context.object.type == 'GREASEPENCIL'
|
||||
|
||||
def execute(self, context):
|
||||
obj = context.object
|
||||
@@ -644,7 +644,7 @@ class GPTB_OT_check_canvas_alignement(Operator):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
# if lock_axis is 'VIEW' then the draw axis is always aligned
|
||||
return context.object and context.object.type == 'GPENCIL'# and context.scene.tool_settings.gpencil_sculpt.lock_axis != 'VIEW'
|
||||
return context.object and context.object.type == 'GREASEPENCIL'# and context.scene.tool_settings.gpencil_sculpt.lock_axis != 'VIEW'
|
||||
|
||||
def execute(self, context):
|
||||
if context.scene.tool_settings.gpencil_sculpt.lock_axis == 'VIEW':
|
||||
@@ -673,7 +673,7 @@ class GPTB_OT_step_select_frames(Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.object and context.object.type == 'GPENCIL'
|
||||
return context.object and context.object.type == 'GREASEPENCIL'
|
||||
|
||||
start : bpy.props.IntProperty(name='Start Frame',
|
||||
description='Start frame of the step animation',
|
||||
|
||||
Reference in New Issue
Block a user