I'm trying to set the size of an object without it's modifiers. So, in a script, I turn off the visible modifiers, then set the scale, then turn them back on. Why doesn't it work?
It does shrink the room and set correctly if I comment out the last:
show_modifiers_master_room(True)
But, when I turn the modifiers back on, the object's scale includes the modifier dimensions (I have a simple Solidify modifier on the object "Master Room"). It appears as if Blender is applying the dimensions after the modifiers are turned back on.
def show_modifiers_master_room(p_bool):
ob = bpy.data.objects['Master Room']
for mod in getattr(ob, "modifiers", []):
mod.show_viewport = p_bool
print ("show mods: " + str(p_bool))
def room_dim_changed_v(self, context):
show_modifiers_master_room(False)
bpy.data.objects['Master Room'].dimensions = (4.0,2.0,2.0)
show_modifiers_master_room(True)
C.scene.objects.get("Master Room")– brockmann Sep 15 '21 at 04:13