PDA

View Full Version : Max Script


Jan Novak
03-27-2003, 01:49 AM
Hi!

Could anybody kidnly kick me into the right direction with MaxScript,
please?
I need to add slice modifier to an object and change the slice plane. I know
how to add the modifier (addModifier b (sliceModifier slice_type:1), but
cannot change the plane. I don't know how to write the syntax correctly. All
I need is an example I will find my way from there. MaxScript help says:
-quote
<sliceModifier>.slice_plane SubAnim
At this sub-object level, you can transform and animate the gizmo like any
other object to determine where the slice occurs. Scaling the gizmo has no
effect, because its extents are effectively infinite. If you need to limit
the extent of the slice, use it on a sub-object selection set of faces,
rather than on the entire object.
<sliceModifier.Slice_Plane>.position Point3 default: [0,0,0] -- animatable
The position of the slice plane object.
<sliceModifier.Slice_Plane>.rotation Quat default: (quat 0 0 0 1) --
animatable
The rotation of the slice plane object.
<sliceModifier.Slice_Plane>.scale Point3 default: [1,1,1] -- animatable
The scale of the slice plane object.
-unquote

Could somebody kindly give me an example how to write this SubAnim into my
slice modifier, please?

Many thanks in advance!

:)
J.

LFShade
03-27-2003, 07:22 AM
You just access the position and rotation as sub-properties of the slicePlane property of the modifier:

slice_mod = sliceModifier slice_type:1
slice_mod.slicePlane.position = [0,0,10]
slice_mod.slicePlane.rotation = eulerAngles 45 0 0 --rotate 45 degrees on X
addModifier b slice_mod

Keep in mind that the gizmo transforms are performed in the object's coordinate space.

:thumbsup:

Jan Novak
03-27-2003, 09:08 PM
Geeky Santa, you just made a little Christmas for me :-) MANY, MANY, MANY, MANY THANKS for sharing your knowledge! I was finally able to finish the script with your tip. You really saved my day. Many days in fact since this task will repeat and would be terrible to do manually every time. You really helped me so much. I can't even express it :-) THANKS, THANKS, THANKS :-)))))

J.

Signal2Noise
03-27-2003, 09:13 PM
You may already be aware of this site, but just in case you're not check out Scriptspot (http://www.scriptspot.com)

Great tutorials, scripts, and forums.

Jan Novak
03-27-2003, 09:49 PM
Nice (and overwhelming) site. Thanks for the tip :)

J.

CGTalk Moderation
01-14-2006, 06:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.