Mesh: Update addons for auto smooth removal #104609

Merged
Hans Goudey merged 10 commits from HooglyBoogly/blender-addons:refactor-mesh-corner-normals-lazy into main 2023-10-20 16:53:48 +02:00
3 changed files with 2 additions and 37 deletions
Showing only changes of commit 36b7bc6274 - Show all commits

View File

@ -1298,12 +1298,9 @@ def make_object_node(ob, translation, rotation, scale, name_id):
obj_node_header_chunk.add_variable("name", _3ds_string(sane_name(name)))
obj_node_header_chunk.add_variable("flags1", _3ds_ushort(0x0040))
"""Flags2 defines 0x01 for display path, 0x02 use autosmooth, 0x04 object frozen,
"""Flags2 defines 0x01 for display path, 0x04 object frozen,
0x10 for motion blur, 0x20 for material morph and bit 0x40 for mesh morph."""
if ob.type == 'MESH' and ob.data.use_auto_smooth:
obj_node_header_chunk.add_variable("flags2", _3ds_ushort(0x02))
else:
obj_node_header_chunk.add_variable("flags2", _3ds_ushort(0))
obj_node_header_chunk.add_variable("flags2", _3ds_ushort(0))
obj_node_header_chunk.add_variable("parent", _3ds_ushort(ROOT_OBJECT))
'''
@ -1343,12 +1340,6 @@ def make_object_node(ob, translation, rotation, scale, name_id):
obj_boundbox.add_variable("max", _3ds_point_3d(ob.bound_box[6]))
obj_node.add_subchunk(obj_boundbox)
# Add smooth angle if autosmooth is used
if ob.type == 'MESH' and ob.data.use_auto_smooth:
obj_morph_smooth = _3ds_chunk(OBJECT_MORPH_SMOOTH)
obj_morph_smooth.add_variable("angle", _3ds_float(round(ob.data.auto_smooth_angle, 6)))
obj_node.add_subchunk(obj_morph_smooth)
# Add track chunks for position, rotation, size
ob_scale = scale[name] # and collect masterscale
if parent is None or (parent.name not in name_id):

View File

@ -171,13 +171,6 @@ class VIEW3D_MT_materialutilities_specials(bpy.types.Menu):
text = "Join by material",
icon = "OBJECT_DATAMODE")
layout.separator()
op = layout.operator(MATERIAL_OT_materialutilities_auto_smooth_angle.bl_idname,
text = "Set Auto Smooth",
icon = "SHADING_SOLID")
op.affect = mu_prefs.set_smooth_affect
op.angle = mu_prefs.auto_smooth_angle
class VIEW3D_MT_materialutilities_main(bpy.types.Menu):
"""Main menu for Material Utilities"""

View File

@ -68,20 +68,6 @@ class VIEW3D_MT_materialutilities_preferences(AddonPreferences):
default = 0
)
set_smooth_affect: EnumProperty(
name = "Set Auto Smooth Affect",
description = "Which objects to affect",
items = mu_affect_enums,
default = 'SELECTED'
)
auto_smooth_angle: FloatProperty(
name = "Auto Smooth Angle",
description = "Maximum angle between face normals that will be considered as smooth",
subtype = 'ANGLE',
min = 0,
max = radians(180),
default = radians(35)
)
def draw(self, context):
layout = self.layout
@ -105,11 +91,6 @@ class VIEW3D_MT_materialutilities_preferences(AddonPreferences):
c.row().prop(self, "link_to", expand = False)
c.row().prop(self, "link_to_affect", expand = False)
d = box.box()
d.label(text = "Set Auto Smooth")
d.row().prop(self, "auto_smooth_angle", expand = False)
d.row().prop(self, "set_smooth_affect", expand = False)
box = layout.box()
box.label(text = "Miscellaneous")