ScriptSpot

Forum topic · General Scripting

align a plane to a slice modifier

By Demiantje · 2011-10-28

Description

Hello everybody, first post here on scriptspot:-)

I have a question, i have a box with a slice modifier on it. and i have plane.
Now I would like to align the plane to slice modifier on box, but i am not very succesfull in this. I hope somebody here on this forum can help me.

greetings,

Demiantje

Comments (5)

.

Haider of Sweden · 2016-01-24

I would like to breath life into this old question by asking for an update.
Would anyone please add the following functionalities
* Align gizmo to object (which could be a plane or anything else) > asks to pick object
* Align object to gizmo > asks to pick object

Thanks!

Vapourise · 2011-10-28

PS my image attachment shows the full script, forgot to mention that :)

Vapourise · 2011-10-28

Hey I just watched this exact thing on the Adv Maxscript DVD, im a newb so dont really understand it but here is a screenshot of the script.

This is the full line of the 'for' loop as it is cut off in the screenshot:

for theObj in selection where superclassof theObj == GeometryClass and classof theObj != TargetObject and theObj != thePlane do

The DVD also goes on to tell you how to make the slice update automatically as you move the plane, let me know if you would like this part too :)

Note this is not my work but that of the guy from the DVD!

Attachments

thank for the hint into the good direction

Demiantje · 2011-10-28

Hey Vapourise,

thank you for your email, but unfortunate this is the other way around i want.
In your example the slice modifier of the box is aligned to a plane, but i would like to have the plane aligned to the slicemodifier of the box.
However you gave me a hint in the good direction and this is the piece of good i needed :-). thanks

theObj = $Sphere001
theMod = theObj.modifiers[1]

$plane001.transform = theObj.transform * inverse theMod.slice_plane.transform