Announcement

Collapse
No announcement yet.

Link slice modifer to world rotation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Link slice modifer to world rotation

    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 ?
    Regards

    Steve

    My Portfolio

  • #2
    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.
    Svetlozar Draganov | Senior Manager 3D Support | contact us
    Chaos & Enscape & Cylindo are now one!

    Comment


    • #3
      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
      Regards

      Steve

      My Portfolio

      Comment


      • #4
        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


        • #5
          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 object
          Gavin Jeoffreys
          Freelance 3D Generalist

          Comment


          • #6
            Originally posted by Raven View Post
            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 object
            Yeah, that's the script but it doesn't get through evaluation. It stops at line 112/113 where it has label1....
            Regards

            Steve

            My Portfolio

            Comment


            • #7
              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"
                  )
              )
              | LinkedIn | Twitter | JCanimator.com |

              Comment


              • #8
                ok thanks Snipey. That's really appreciated
                Regards

                Steve

                My Portfolio

                Comment

                Working...
                X