I’m trying to do a fake, simple simulation of wine in a glass just by linking the rotation of the slice to world rotation. That way the wine slice will always stay level. Any ideas ?
Not sure how to do it directly in 3dsMax but here is a script that could be useful:
Another option is to use a boolean-objects instead of Slice modifier, it should be easier to control the rotations of both objects independently from each other.
Funnily enough I found that script but couldn’t get it working on max 2016. Evaluation just caused an error. I’ll take a look at boolean. Thanks
You can also create a pair of position and orientation constraints on a helper, then copy these controllers as instance to the position and rotation controllers of the gizmo of your slice plane.
Keep the original helper to access the animation parameters from outside that are then instanced to the gizmo.
Hey Steve
Not sure if this is the script you found, I’ve used it before worked great, have not checked if it works in 2016.
Links the gizmo to a control object
Yeah, that’s the script but it doesn’t get through evaluation. It stops at line 112/113 where it has label1…
Without trying to run it myself, not sure what is wrong with Martin’s script, but his is generally the ‘right way’ that I usually reference. The idea is putting a script controller on the modifier transform property, which then does the matrix math to go from gizmo space, to world space, into object space of another ‘target’ object. Below is the cheap hacky version without any error checking.
Select objects you want to slice and then run the script below, it’s hardcoded to use an object named Plane001 as the “slice control” object. A word of caution - if you run this on multiple objects and then delete Plane001 - you’ll get tons of script error dialogs, so that’s why martin’s ‘better’ version has an if check to make sure the object is valid, and if it’s not it default to a base matrix.
(
objs = selection as array
for o in objs do (
theMod = SliceModifier()
addModifier o theMod
theMod.Slice_Plane.Controller = transform_script()
theMod.Slice_Plane.Controller.IScriptCtrl.AddNode "Self" o
theMod.Slice_Plane.Controller.script = "$Plane001.transform * inverse self.objectTransform"
)
)
ok thanks Snipey. That’s really appreciated