new addon simple_deform_helper #104464

Closed
EMM wants to merge 29 commits from Guai_Wo_Ge_EMM/blender-addons:simple_deform_helper into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
6 changed files with 78 additions and 4 deletions
Showing only changes of commit b9c7dcdc34 - Show all commits

View File

@ -20,6 +20,55 @@ bl_info = {
"category": "3D View"
}
"""
# -------------------------
__init__.py:
Register All Module
gizmo/__init__.py:
Register All Gizmo
/angle_and_factor.py:
Ctrl Modifier Angle
/bend_axis.py:
Bend Method Switch Direction Gizmo
/set_deform_axis.py:
Three Switch Deform Axis Operator Gizmo
/up_down_limits_point.py:
Main control part
use utils.py PublicProperty._get_limits_point_and_bound_box_co
Obtain and calculate boundary box and limit point data
draw.py:
Draw 3D Bound And Line
gizmo.json:
Draw Custom Shape Vertex Data
operator.py:
Set Deform Axis Operator
panel.py:
Draw Gizmo Tool Property in Options and Tool Settings Right
preferences.py:
Addon Preferences
translate.py:
temporary only Cn translate
update.py:
In Change Depsgraph When Update Addon Data And Del Redundant Empty
utils.py:
Main documents used
Most computing operations are placed in classes GizmoUtils
# -------------------------
"""
module_tuple = (
panel,
gizmo,

View File

@ -46,7 +46,6 @@ class DeformAxisOperator(Operator, GizmoUtils):
if not event.ctrl:
self.pref.display_bend_axis_switch_gizmo = False
# self.new_origin_empty_object()
return {'FINISHED'}

View File

@ -62,6 +62,14 @@ class SimpleDeformGizmoAddonPreferences(AddonPreferences, GizmoUtils):
def draw(self, context):
col = self.layout.column()
box = col.box()
for text in ("You can press the following shortcut keys when dragging values",
" Wheel: Switch Origin Ctrl Mode",
" X、Y、Z: Switch Modifier Deform Axis",
" W: Switch Deform Wireframe Show",
" A: Switch To Select Bend Axis Mode(deform_method=='BEND')",):
box.label(text=self.translate_text(text))
col.prop(self, 'deform_wireframe_color')
col.prop(self, 'bound_box_color')
col.prop(self, 'limits_bound_box_color')

View File

@ -12,6 +12,18 @@ translations_dict = {
"zh_CN": {
("上下文", "原文"): "翻译文字",
("*", "Show Toggle Bend Axis Gizmo"): "显示切换弯曲轴向Gizmo",
("*", "You can press the following shortcut keys when dragging values"):
"拖动值时可以按以下快捷键",
("*", " Wheel: Switch Origin Ctrl Mode"):
" 滚轮: 切换原点控制模式",
("*", " X、Y、Z: Switch Modifier Deform Axis"):
" X、Y、Z: 切换修改器型变轴",
("*", " W: Switch Deform Wireframe Show"):
" W: 切换形变线框显示",
("*",
" A: Switch To Select Bend Axis Mode(deform_method=='BEND')"):
" A: 切换到选择弯曲轴模式(形变方法='弯曲')",
("*", "Show Set Axis Button"): "显示设置轴向Gizmo",
("*", "Follow Upper Limit(Red)"): "跟随上限(红色)",

View File

@ -15,12 +15,19 @@ def remove_not_use_empty(scene, dep):
gizmo = GizmoUpdate()
gizmo.clear_cache()
gizmo.fix_origin_parent_and_angle()
# remove redundant empty object
if gizmo.simple_deform_modifier_is_simple(context):
for obj in context.scene.objects:
is_empty = obj.type == "EMPTY"
not_parent = not obj.parent
if remove_name in obj.name and not_parent and is_empty:
bpy.data.objects.remove(obj) # remove object
bpy.data.objects.remove(obj)
# simple update data if change active object on update
update_data = gizmo.obj not in gizmo.G_GizmoData or gizmo.obj != gizmo.G_GizmoData[gizmo.obj]
if update_data:
gizmo.clear_data()
gizmo.G_GizmoData[gizmo.obj] = 'Emm'
def register():

View File

@ -761,8 +761,7 @@ class GizmoUtils(GizmoUpdate):
...
def event_handle(self, event):
"""General event triggeringXXX"""
# event ctrl
"""General event triggering"""
data_path = ('object.SimpleDeformGizmo_PropertyGroup.origin_mode',
'object.modifiers.active.origin.SimpleDeformGizmo_PropertyGroup.origin_mode')