Notifications
Clear all

[Closed] Camera Help

Hey Guys,

I am having big problems with a script im working partly because im still new to maxscript. I have a script that creates 3 new cams one center one left and one right where by the left and right are constrained to the center cam via float script, the way in which i am doing this is flored in it being that you can only have one set of cams in the scene because im using a global in the float script… if that makes any sense at all… anyways i have racked my brain with this one, so any help you have will be much appreciated…

as you can see the script sought of works in a limted capacity as is, however there is a button that is empty, this button is “supposed” to create the same type of camreas as the rest of the script but on a selected camera, the selected cam would become the center cam… once again if that makes any sense? well at least to my twisted sense of logic…

heres the code, im sure its riddled with problems so if you guys could point me in the right direction i would be very thankful

cheers
Dave

global perVal

rollout stezzaCams “Stero Cams” width:176 height:392

(

button btnCams “Create Cameras” pos:[16,24] width:144 height:56

button btnCamSel “Create Cams on Selected” pos:[16,88] width:144 height:56

button btnCons “Rig Cameras” pos:[16,192] width:144 height:56

spinner spnPer “” pos:[96,160] width:64 height:16 range:[0,100,4]

label lbl1 “Xpos ” pos:[16,160] width:72 height:16

groupBox grp1 “Stero Cams” pos:[8,8] width:160 height:312

on btnCams pressed do

(

–Create Cameras

Targetcamera fov:45 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off pos:[0,0,0] isSelected:on target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [-0.194553,166.342,0]))

Targetcamera fov:45 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off pos:[-30,0,0] isSelected:on target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [-0.194553,166.342,0]))

Targetcamera fov:45 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off pos:[30,0,0] isSelected:on target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [-0.194553,166.342,0]))

–Name Cameras

$Camera01.name = “CenterCam”

$Camera03.name = “RightCam”

$Camera02.name = “LeftCam”

–Cam Colours

$RightCam.wirecolor = color 28 28 177

$LeftCam.wirecolor = color 28 28 177

$CenterCam.wirecolor = color 255 0 0

–Cam Targets

$RightCam.target = $CenterCam.target

$LeftCam.target = $CenterCam.target

)

on btnCons pressed do

(

–Parent Cameras

$RightCam.parent = $CenterCam

$LeftCam.parent = $CenterCam

–Assign Script Controller to Right Cam

$RightCam.position.X_Position.controller = float_script()

$RightCam.position.X_Position.controller.script = “$CenterCam.targetDistance * perVal / 100 / 2”

–Assign Script Controller to Left Cam

$LeftCam.position.X_Position.controller = float_script()

$LeftCam.position.X_Position.controller.script = “-$CenterCam.targetDistance * perVal / 100 / 2”

–Wire Right Cam

paramWire.connect $CenterCam.transform.controller[#Roll_Angle] $RightCam.transform.controller[#Roll_Angle] “Roll_Angle”

–Wire Left Cam Roll

paramWire.connect $CenterCam.transform.controller[#Roll_Angle] $LeftCam.transform.controller[#Roll_Angle] “Roll_Angle”

)

on btnCamSel pressed do

(

–arrrrghhhh help

)

on spnPer changed val do

(

global perVal = spnPer.value

)

)

CreateDialog stezzaCams 176 392