fix crop json export and add extra ui
0.6.6 - fix: problem when creating Json - ui: add gp render extras panel in scene prop (closed by default)
This commit is contained in:
+30
-7
@@ -80,6 +80,7 @@ def export_AE_objects_position_keys():
|
||||
|
||||
blend = Path(bpy.data.filepath)
|
||||
keyfile = blend.parent / 'render' / f'pos_{name}.txt'
|
||||
keyfile.parent.mkdir(parents=False, exist_ok=True)
|
||||
|
||||
print(f'exporting keys for {name}')
|
||||
with open(keyfile, 'w') as fd:
|
||||
@@ -179,27 +180,49 @@ class GPEXP_OT_fix_overscan_shift(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
def overcan_shift_fix_ui(self, context):
|
||||
layout = self.layout
|
||||
layout.operator("gp.fix_overscan_shift")
|
||||
# ui panel
|
||||
class GPEXP_PT_extra_gprender_func(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "output"
|
||||
bl_label = "GP Render Extras"
|
||||
bl_parent_id = "RENDER_PT_format" if (3, 0, 0) <= bpy.app.version else "RENDER_PT_dimensions"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
# COMPAT_ENGINES = {'CYCLES', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
||||
|
||||
# def draw_header(self, context):
|
||||
# overscan = context.scene.camera_overscan
|
||||
# self.layout.prop(overscan, "RO_Activate", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator("gp.fix_overscan_shift")
|
||||
layout.operator("gp.export_keys_to_ae")
|
||||
|
||||
|
||||
|
||||
# def overcan_shift_fix_ui(self, context):
|
||||
# layout = self.layout
|
||||
# layout.operator("gp.fix_overscan_shift")
|
||||
|
||||
|
||||
classes=(
|
||||
GPEXP_OT_export_keys_to_ae,
|
||||
GPEXP_OT_fix_overscan_shift,
|
||||
GPEXP_PT_extra_gprender_func
|
||||
)
|
||||
|
||||
def register():
|
||||
for cls in classes:
|
||||
bpy.utils.register_class(cls)
|
||||
|
||||
if hasattr(bpy.types, 'RENDER_PT_overscan'):
|
||||
bpy.types.RENDER_PT_overscan.append(overcan_shift_fix_ui)
|
||||
# if hasattr(bpy.types, 'RENDER_PT_overscan'):
|
||||
# bpy.types.RENDER_PT_overscan.append(overcan_shift_fix_ui)
|
||||
|
||||
|
||||
def unregister():
|
||||
if hasattr(bpy.types, 'RENDER_PT_overscan'):
|
||||
bpy.types.RENDER_PT_overscan.remove(overcan_shift_fix_ui)
|
||||
# if hasattr(bpy.types, 'RENDER_PT_overscan'):
|
||||
# bpy.types.RENDER_PT_overscan.remove(overcan_shift_fix_ui)
|
||||
|
||||
for cls in reversed(classes):
|
||||
bpy.utils.unregister_class(cls)
|
||||
|
||||
Reference in New Issue
Block a user