PDA

View Full Version : maxscript help for a beginner


SneezingDonkey
08-31-2006, 08:13 AM
hi, im VERY new to scripting and i may be asking really dumb questions, but here it goes.

what im trying to do is:

create a camera01
move/rotate
set render width/height
set the camera01 as the viewport
hide the object CLIPPING_01
hide bone objects
make preview at 100% and set a name for the preview file as the scene name

what ive got:

macroScript Macro6
category:"DragAndDrop"
toolTip:"CamSetup"
(
Freecamera fov:45 targetDistance:160 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off
move $Camera01 [0,-245,131.2]
renderWidth = 480
renderHeight = 640
rotate $Camera01 (angleaxis 90 [1,0,0])
max vpt camera
select $CLIPPING_01
max hide selection
)

thats all ive got so far, but setting the vpt camera and hiding the object doesnt seem to work when i run the script. can anyone tell me why?
and is there a command to get the scene name?

thanks.

Wahooney
08-31-2006, 02:47 PM
Try this:

macroScript Macro6
category:"DragAndDrop"
toolTip:"CamSetup"
(
local cam = Freecamera fov:45 targetDistance:160 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off
move cam [0,-245,131.2]
renderWidth = 480
renderHeight = 640
rotate cam (angleaxis 90 [1,0,0])
viewport.activeViewport = 1
viewport.setCamera cam
hide $CLIPPING_01
)

SneezingDonkey
08-31-2006, 04:07 PM
ooh thanks that works!

would you know how to hide bone objects in the scene?

Wahooney
08-31-2006, 04:17 PM
unhide $object_name

:thumbsup:

SneezingDonkey
09-01-2006, 08:57 AM
sorry, i meant how do you hide bone objects in one command rather than go through an entire skeleton hiding bones individually. i thought this would be possible as there is a box in the preview dialog where you can turn bones off.

Wahooney
09-01-2006, 09:01 AM
hidebycategory.bones = true

:thumbsup:

SneezingDonkey
09-01-2006, 11:20 AM
woohoooo! thanks!

CGTalk Moderation
09-01-2006, 11:20 AM
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.