[Closed] Std Cam Extension Script Plugin
I am working on a plugin script that creates depth planes in the viewport when a FreeCamera is created. I can create the planes fine, but the camera itself will not appear in the viewport. It seems to happen when I use the ‘tool create’ command. The FreeCameras I create show up fine, but I still want to see the original camera. Any suggestions?
Here is a section of the code:
tool create
(on mousePoint click do
case click of
(
1: (FreeCamera name:“MainCam” pos:gridpoint
————–clone cameras——————
local cloneList = #()
for i = 1 to 8 do
(
maxOps.cloneNodes $MainCam offset:[((4.5-i)($MainCam.Target_Distance)/(convergence)),0,0] cloneType:#instance newNodes:&cloneList
cloneList.parent=$MainCam
)
————–make planes—————–
local planes = #(“pNear”, “pZero”, “pFar”)
local offset = #(-$MainCam.Target_Distance/2, -$MainCam.Target_Distance, -$MainCam.Target_Distance2)
local color = #(red, green, blue)
for i = 1 to 3 do
(Plane name:planes[i] length:100 width:100 pos:(gridpoint + [0,0,offset[i]]) wireColor:color[i] renderable:false backfaceCull:false isFrozen:true showFrozenInGray:false parent:$MainCam
)
————-set planes visibility———
local planes2 = #($pNear, $pZero, $pFar)
for i = 1 to 3 do
(planes2[i].visibility=bezier_float()
planes2[i].visibility.controller.value=0.5
)
—testing—
--transformations----
rotate $MainCam (angleaxis 90 [1,0,0])
)
2: #stop
)
on mouseMove click do
case click of
(
2: (nodeTM.pos = gridPoint
$MainCam.pos = gridPoint
)
)
)
Does this need clarification, or is it just to advanced an issue? Should I call discreet on this one?
Sean
slooper,
it’s a bit hard to track down any problems given only this small part of the script. there are a couple of undefined variables that cause the script to throw errors… could you send a more complete, working version?
Martijn
Here is the entire script. It seems to create the ‘root’ camera, or at least the bounding box for it. I need to resolve this bug quickly if anyone can be of help! Thanks so much!
Sean