Mesh: Update addons for auto smooth removal #104609
@ -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("name", _3ds_string(sane_name(name)))
|
||||||
obj_node_header_chunk.add_variable("flags1", _3ds_ushort(0x0040))
|
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."""
|
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(0))
|
||||||
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("parent", _3ds_ushort(ROOT_OBJECT))
|
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_boundbox.add_variable("max", _3ds_point_3d(ob.bound_box[6]))
|
||||||
obj_node.add_subchunk(obj_boundbox)
|
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
|
# Add track chunks for position, rotation, size
|
||||||
ob_scale = scale[name] # and collect masterscale
|
ob_scale = scale[name] # and collect masterscale
|
||||||
if parent is None or (parent.name not in name_id):
|
if parent is None or (parent.name not in name_id):
|
||||||
|
@ -171,13 +171,6 @@ class VIEW3D_MT_materialutilities_specials(bpy.types.Menu):
|
|||||||
text = "Join by material",
|
text = "Join by material",
|
||||||
icon = "OBJECT_DATAMODE")
|
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):
|
class VIEW3D_MT_materialutilities_main(bpy.types.Menu):
|
||||||
"""Main menu for Material Utilities"""
|
"""Main menu for Material Utilities"""
|
||||||
|
@ -68,20 +68,6 @@ class VIEW3D_MT_materialutilities_preferences(AddonPreferences):
|
|||||||
default = 0
|
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):
|
def draw(self, context):
|
||||||
layout = self.layout
|
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", expand = False)
|
||||||
c.row().prop(self, "link_to_affect", 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 = layout.box()
|
||||||
box.label(text = "Miscellaneous")
|
box.label(text = "Miscellaneous")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user