mesh_outline_projection #1
1 changed files with 24 additions and 1 deletions
|
|
@ -632,20 +632,43 @@ class VIEW3D_PT_outline_project(bpy.types.Panel):
|
||||||
layout.label(text="2. Active = target mesh", icon='OBJECT_DATA')
|
layout.label(text="2. Active = target mesh", icon='OBJECT_DATA')
|
||||||
layout.label(text="3. Press Numpad 7 (top view)", icon='CAMERA_DATA')
|
layout.label(text="3. Press Numpad 7 (top view)", icon='CAMERA_DATA')
|
||||||
|
|
||||||
|
# Add settings box
|
||||||
|
box = layout.box()
|
||||||
|
box.label(text="Settings:")
|
||||||
|
box.prop(context.scene, 'outline_dissolve_angle', text="Dissolve Angle", slider=True)
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.scale_y = 1.5
|
row.scale_y = 1.5
|
||||||
row.operator("mesh.outline_project", icon='MOD_UVPROJECT')
|
op = row.operator("mesh.outline_project", icon='MOD_UVPROJECT')
|
||||||
|
|
||||||
|
# Pass the scene value to the operator
|
||||||
|
op.dissolve_angle = context.scene.outline_dissolve_angle
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
bpy.utils.register_class(MESH_OT_outline_project)
|
bpy.utils.register_class(MESH_OT_outline_project)
|
||||||
bpy.utils.register_class(VIEW3D_PT_outline_project)
|
bpy.utils.register_class(VIEW3D_PT_outline_project)
|
||||||
|
|
||||||
|
# Register scene property for UI
|
||||||
|
bpy.types.Scene.outline_dissolve_angle = bpy.props.FloatProperty(
|
||||||
|
name="Dissolve Angle",
|
||||||
|
description="Angle threshold for Limit Dissolve (degrees)",
|
||||||
|
default=0.04,
|
||||||
|
min=0.0,
|
||||||
|
max=5.0,
|
||||||
|
step=0.01,
|
||||||
|
precision=3
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
bpy.utils.unregister_class(VIEW3D_PT_outline_project)
|
bpy.utils.unregister_class(VIEW3D_PT_outline_project)
|
||||||
bpy.utils.unregister_class(MESH_OT_outline_project)
|
bpy.utils.unregister_class(MESH_OT_outline_project)
|
||||||
|
|
||||||
|
# Unregister scene property
|
||||||
|
if hasattr(bpy.types.Scene, 'outline_dissolve_angle'):
|
||||||
|
del bpy.types.Scene.outline_dissolve_angle
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
register()
|
register()
|
||||||
Loading…
Reference in a new issue