Addon: Mesh Extra Objects: Added soft limiters in Gear and WormGear. Added restore materials if you go back to change parameters.
This commit is contained in:
parent
17727caac2
commit
8bb3714e95
|
@ -586,69 +586,69 @@ class AddGear(Operator):
|
|||
number_of_teeth: IntProperty(name="Number of Teeth",
|
||||
description="Number of teeth on the gear",
|
||||
min=2,
|
||||
#max=265,
|
||||
soft_max=1000,
|
||||
default=12
|
||||
)
|
||||
radius: FloatProperty(name="Radius",
|
||||
description="Radius of the gear, negative for crown gear",
|
||||
#min=-100.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=1.0
|
||||
)
|
||||
addendum: FloatProperty(name="Addendum",
|
||||
description="Addendum, extent of tooth above radius",
|
||||
#min=0.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.1
|
||||
)
|
||||
dedendum: FloatProperty(name="Dedendum",
|
||||
description="Dedendum, extent of tooth below radius",
|
||||
#min=0.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.1
|
||||
)
|
||||
angle: FloatProperty(name="Pressure Angle",
|
||||
description="Pressure angle, skewness of tooth tip",
|
||||
#min=0.0,
|
||||
#max=radians(45.0),
|
||||
soft_min=radians(-45.0),
|
||||
soft_max=radians(45.0),
|
||||
unit='ROTATION',
|
||||
default=radians(20.0)
|
||||
)
|
||||
base: FloatProperty(name="Base",
|
||||
description="Base, extent of gear below radius",
|
||||
#min=0.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.2
|
||||
)
|
||||
width: FloatProperty(name="Width",
|
||||
description="Width, thickness of gear",
|
||||
#min=0.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.2
|
||||
)
|
||||
skew: FloatProperty(name="Skewness",
|
||||
description="Skew of teeth",
|
||||
#min=radians(-90.0),
|
||||
#max=radians(90.0),
|
||||
soft_min=radians(-360.0),
|
||||
soft_max=radians(360.0),
|
||||
unit='ROTATION',
|
||||
default=radians(0.0)
|
||||
)
|
||||
conangle: FloatProperty(name="Conical angle",
|
||||
description="Conical angle of gear",
|
||||
#min=0.0,
|
||||
#max=radians(90.0),
|
||||
soft_min=radians(-360.0),
|
||||
soft_max=radians(360.0),
|
||||
unit='ROTATION',
|
||||
default=radians(0.0)
|
||||
)
|
||||
crown: FloatProperty(name="Crown",
|
||||
description="Inward pointing extend of crown teeth",
|
||||
#min=0.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.0
|
||||
)
|
||||
|
@ -682,12 +682,18 @@ class AddGear(Operator):
|
|||
if 'Gear' in obj.data.keys():
|
||||
oldmesh = obj.data
|
||||
oldmeshname = obj.data.name
|
||||
oldmeshmaterials = obj.data.materials
|
||||
|
||||
mesh, verts_tip, verts_valley = AddGearMesh(self, context)
|
||||
obj.data = mesh
|
||||
try:
|
||||
bpy.ops.object.vertex_group_remove(all=True)
|
||||
except:
|
||||
pass
|
||||
|
||||
for material in oldmeshmaterials:
|
||||
obj.data.materials.append(material)
|
||||
|
||||
bpy.data.meshes.remove(oldmesh)
|
||||
obj.data.name = oldmeshname
|
||||
else:
|
||||
|
@ -787,69 +793,69 @@ class AddWormGear(Operator):
|
|||
name="Number of Teeth",
|
||||
description="Number of teeth on the gear",
|
||||
min=1,
|
||||
#max=265,
|
||||
soft_max=1000,
|
||||
default=12
|
||||
)
|
||||
number_of_rows: IntProperty(
|
||||
name="Number of Rows",
|
||||
description="Number of rows on the worm gear",
|
||||
min=0,
|
||||
#max=265,
|
||||
soft_max=1000,
|
||||
default=32
|
||||
)
|
||||
radius: FloatProperty(
|
||||
name="Radius",
|
||||
description="Radius of the gear, negative for crown gear",
|
||||
#min=-100.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=1.0
|
||||
)
|
||||
addendum: FloatProperty(
|
||||
name="Addendum",
|
||||
description="Addendum, extent of tooth above radius",
|
||||
#min=0.01,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.1
|
||||
)
|
||||
dedendum: FloatProperty(
|
||||
name="Dedendum",
|
||||
description="Dedendum, extent of tooth below radius",
|
||||
#min=0.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.1
|
||||
)
|
||||
angle: FloatProperty(
|
||||
name="Pressure Angle",
|
||||
description="Pressure angle, skewness of tooth tip",
|
||||
#min=0.0,
|
||||
#max=radians(45.0),
|
||||
soft_min=radians(-45.0),
|
||||
soft_max=radians(45.0),
|
||||
default=radians(20.0),
|
||||
unit='ROTATION'
|
||||
)
|
||||
row_height: FloatProperty(
|
||||
name="Row Height",
|
||||
description="Height of each Row",
|
||||
#min=0.05,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.2
|
||||
)
|
||||
skew: FloatProperty(
|
||||
name="Skewness per Row",
|
||||
description="Skew of each row",
|
||||
#min=radians(-90.0),
|
||||
#max=radians(90.0),
|
||||
soft_min=radians(-360.0),
|
||||
soft_max=radians(360.0),
|
||||
default=radians(11.25),
|
||||
unit='ROTATION'
|
||||
)
|
||||
crown: FloatProperty(
|
||||
name="Crown",
|
||||
description="Inward pointing extend of crown teeth",
|
||||
#min=0.0,
|
||||
#max=100.0,
|
||||
soft_min=-1000.0,
|
||||
soft_max=1000.0,
|
||||
unit='LENGTH',
|
||||
default=0.0
|
||||
)
|
||||
|
@ -879,12 +885,18 @@ class AddWormGear(Operator):
|
|||
if 'WormGear' in obj.data.keys():
|
||||
oldmesh = obj.data
|
||||
oldmeshname = obj.data.name
|
||||
oldmeshmaterials = obj.data.materials
|
||||
|
||||
mesh, verts_tip, verts_valley = AddWormGearMesh(self, context)
|
||||
obj.data = mesh
|
||||
try:
|
||||
bpy.ops.object.vertex_group_remove(all=True)
|
||||
except:
|
||||
pass
|
||||
|
||||
for material in oldmeshmaterials:
|
||||
obj.data.materials.append(material)
|
||||
|
||||
bpy.data.meshes.remove(oldmesh)
|
||||
obj.data.name = oldmeshname
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue