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 ?
Announcement
Collapse
No announcement yet.
Link slice modifer to world rotation
Collapse
X
-
Not sure how to do it directly in 3dsMax but here is a script that could be useful:
http://www.breidt.net/scripts/#gizmoControl
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.
-
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.
Comment
-
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.
http://www.scriptspot.com/3ds-max/scripts/gizmocontrol
Links the gizmo to a control objectGavin Jeoffreys
Freelance 3D Generalist
Comment
-
Originally posted by Raven View PostHey 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.
http://www.scriptspot.com/3ds-max/scripts/gizmocontrol
Links the gizmo to a control object
Comment
-
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.
Code:( 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" ) )
Comment
Comment