Palette linker

1.8.0

- feat: palette linker (beta), with pop-up from material stack dropdown
- feat: palette name fuzzy match
- code: add an open addon preference ops
This commit is contained in:
Pullusb
2021-12-04 13:57:32 +01:00
parent 78b70c8fca
commit 6c19fa54af
9 changed files with 546 additions and 193 deletions
+11 -34
View File
@@ -323,8 +323,6 @@ class GPTB_OT_reset_cam_rot(bpy.types.Operator):
def execute(self, context):
cam = context.scene.camera
# self.cam_init_euler = self.cam.rotation_euler.copy()
if not cam.parent or cam.parent.type != 'CAMERA':
self.report({'ERROR'}, "No parents to refer to for rotation reset")
return {"CANCELLED"}
@@ -362,40 +360,8 @@ class GPTB_OT_reset_cam_rot(bpy.types.Operator):
new_cam_offset = mathutils.Vector((new_cam_offset[0], new_cam_offset[1] * self.ratio_inv)) # restore screen ratio
context.space_data.region_3d.view_camera_offset = new_cam_offset
return {"FINISHED"}
""" # old simple cam draw fit to cam
class GPTB_OT_reset_cam_rot(bpy.types.Operator):
bl_idname = "gp.reset_cam_rot"
bl_label = "Reset rotation"
bl_description = "Reset rotation of the draw manipulation camera"
bl_options = {"REGISTER"}
@classmethod
def poll(cls, context):
return context.scene.camera and not context.scene.camera.name.startswith('Cam')
# return context.region_data.view_perspective == 'CAMERA'# check if in camera
def execute(self, context):
# dcam_name = 'draw_cam'
# camcol_name = 'manip_cams'
drawcam = context.scene.camera
if drawcam.parent.type == 'CAMERA':
## align to parent camera
drawcam.matrix_world = drawcam.parent.matrix_world#wrong, get the parent rotation offset
# drawcam.rotation_euler = drawcam.parent.rotation_euler#wrong, get the parent rotation offset
elif drawcam.parent:
## there is a parent, so align the Y of the camera to object's Z
# drawcam.rotation_euler.rotate(drawcam.parent.matrix_world)# wrong
pass
else:
self.report({'ERROR'}, "No parents to refer to for rotation reset")
return {"CANCELLED"}
return {"FINISHED"}
"""
class GPTB_OT_toggle_mute_animation(bpy.types.Operator):
bl_idname = "gp.toggle_mute_animation"
bl_label = "Toggle Animation Mute"
@@ -630,6 +596,16 @@ class GPTB_OT_check_canvas_alignement(bpy.types.Operator):
# self.report({ret}, message)
return {'FINISHED'}
class GPTB_OT_open_addon_prefs(bpy.types.Operator):
bl_idname = "gptb.open_addon_prefs"
bl_label = "Open Addon Prefs"
bl_description = "Open user preferences window in addon tab and prefill the search with addon name"
bl_options = {"REGISTER", "INTERNAL"}
def execute(self, context):
utils.open_addon_prefs()
return {'FINISHED'}
classes = (
GPTB_OT_copy_text,
GPTB_OT_flipx_view,
@@ -642,6 +618,7 @@ GPTB_OT_toggle_hide_gp_modifier,
GPTB_OT_list_disabled_anims,
GPTB_OT_clear_active_frame,
GPTB_OT_check_canvas_alignement,
GPTB_OT_open_addon_prefs,
)
def register():