Skip to content

Commit

Permalink
feat: rectify the mod order for lattice, simple_deform, profile_extru…
Browse files Browse the repository at this point in the history
…de, screw, solidify, array_cubed, and circular_array operators
  • Loading branch information
tristan-hm committed Jun 25, 2022
1 parent 7ce7f30 commit 2ccb087
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deform/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .. lib.collections import move_to_utils_collection, isolate_in_utils_collection, hide_utils_collection
from .. lib.math import generate_bounding_box, v3_average
from .. lib.numeric_input import update_stream, no_stream, get_stream_value, new_stream
from .. lib.modifiers import rectify_mod_order


mod_lattice = "Lattice — ND L"
Expand Down Expand Up @@ -295,6 +296,8 @@ def add_lattice_modifier(self, context):
lattice.object = self.lattice_obj
lattice.show_expanded = False

rectify_mod_order(context.active_object, lattice.name)

self.lattice = lattice


Expand Down
3 changes: 3 additions & 0 deletions deform/simple_deform.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .. lib.preferences import get_preferences
from .. lib.axis import init_axis, register_axis_handler, unregister_axis_handler
from .. lib.numeric_input import update_stream, no_stream, get_stream_value, new_stream
from .. lib.modifiers import rectify_mod_order


mod_deform = "Deform — ND SD"
Expand Down Expand Up @@ -201,6 +202,8 @@ def add_simple_deform_modifier(self, context):
deform = context.active_object.modifiers.new(mod_deform, 'SIMPLE_DEFORM')
deform.show_expanded = False

rectify_mod_order(context.active_object, deform.name)

self.deform = deform


Expand Down
7 changes: 7 additions & 0 deletions extrusion/profile_extrude.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from .. lib.preferences import get_preferences
from .. lib.axis import init_axis, register_axis_handler, unregister_axis_handler
from .. lib.numeric_input import update_stream, no_stream, get_stream_value, new_stream
from .. lib.modifiers import rectify_mod_order


mod_screw = "Extrusion — ND PE"
Expand Down Expand Up @@ -240,6 +241,8 @@ def add_weighting_modifier(self, context):
offset.mid_level = 0
offset.show_expanded = False

rectify_mod_order(context.active_object, offset.name)

self.weighting_offset = offset


Expand All @@ -249,6 +252,8 @@ def add_offset_modifier(self, context):
offset.mid_level = 0
offset.show_expanded = False

rectify_mod_order(context.active_object, offset.name)

self.displace = offset


Expand All @@ -259,6 +264,8 @@ def add_screw_modifier(self, context):
screw.angle = 0
screw.show_expanded = False

rectify_mod_order(context.active_object, screw.name)

self.screw = screw


Expand Down
5 changes: 5 additions & 0 deletions extrusion/screw.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .. lib.preferences import get_preferences
from .. lib.axis import init_axis, register_axis_handler, unregister_axis_handler
from .. lib.numeric_input import update_stream, no_stream, get_stream_value, new_stream
from .. lib.modifiers import rectify_mod_order


mod_displace = "Offset — ND SCR"
Expand Down Expand Up @@ -239,6 +240,8 @@ def add_displace_modifier(self, context):
displace.mid_level = 0
displace.space = 'LOCAL'
displace.show_expanded = False

rectify_mod_order(context.active_object, displace.name)

self.displace = displace

Expand All @@ -251,6 +254,8 @@ def add_screw_modifier(self, context):
screw.use_normal_calculate = True
screw.show_expanded = False

rectify_mod_order(context.active_object, screw.name)

self.screw = screw


Expand Down
5 changes: 5 additions & 0 deletions extrusion/solidify.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from .. lib.events import capture_modifier_keys, pressed
from .. lib.preferences import get_preferences
from .. lib.numeric_input import update_stream, no_stream, get_stream_value, new_stream
from .. lib.modifiers import rectify_mod_order


mod_displace = "Offset — ND SOL"
Expand Down Expand Up @@ -213,6 +214,8 @@ def add_displace_modifier(self, context):
displace.mid_level = 0
displace.show_expanded = False

rectify_mod_order(context.active_object, displace.name)

self.displace = displace


Expand All @@ -222,6 +225,8 @@ def add_solidify_modifier(self, context):
solidify.show_expanded = False
solidify.nonmanifold_thickness_mode = 'CONSTRAINTS'

rectify_mod_order(context.active_object, solidify.name)

self.solidify = solidify


Expand Down
3 changes: 3 additions & 0 deletions replicate/array_cubed.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from .. lib.preferences import get_preferences
from .. lib.axis import init_axis, register_axis_handler, unregister_axis_handler
from .. lib.numeric_input import update_stream, no_stream, get_stream_value, new_stream
from .. lib.modifiers import rectify_mod_order


mod_array_x = "Array³ X — ND"
Expand Down Expand Up @@ -217,6 +218,8 @@ def add_array_modifier(self, context, name, axis):
array.show_expanded = False

self.axes[axis] = [array, 1, 2]

rectify_mod_order(context.active_object, array.name)


def operate(self, context):
Expand Down
7 changes: 7 additions & 0 deletions replicate/circular_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from .. lib.preferences import get_preferences
from .. lib.objects import set_origin
from .. lib.numeric_input import update_stream, no_stream, get_stream_value, new_stream
from .. lib.modifiers import rectify_mod_order


mod_displace = 'Displace — ND CA'
Expand Down Expand Up @@ -291,6 +292,8 @@ def add_array_modifier(self):
array.offset_object = self.rotator_obj
array.show_expanded = False

rectify_mod_order(self.reference_obj, array.name)

self.array = array


Expand All @@ -308,6 +311,8 @@ def add_displace_tranform_modifiers(self):
displace.strength = self.reference_obj_prev_location[index] - self.reference_obj.location[index]
displace.show_expanded = False

rectify_mod_order(self.reference_obj, displace.name)

self.displace_transforms.append(displace)


Expand All @@ -319,6 +324,8 @@ def add_displace_modifier(self):
displace.show_on_cage = True
displace.show_expanded = False

rectify_mod_order(self.reference_obj, displace.name)

if self.single_obj_mode:
self.offset = self.reference_obj.dimensions[self.axis]
displace.strength = self.offset
Expand Down

0 comments on commit 2ccb087

Please sign in to comment.