View Full Version : Scriptjob to know about cameras
katisss 02-28-2007, 03:42 PM How would i do a Scriptjob to watch the creation/deleting/renaming of cameras in my scene to use it in an UI?
Would i need to keep all cameras in an array and check or is there an easier way?
EDIT:
i found this which is helpful when a camera is created
scriptJob -e DagObjectCreated "foo";
How would i know about it beeing deleted or renamed?
|
|
katisss
03-01-2007, 11:00 AM
This is close
http://forums.cgsociety.org/showthread.php?f=89&t=238415&highlight=DagObjectCreated
proc rebuildNewCamList(string $camera)
{
print("my" + $camera + "\n");
//UpdateWindow
}
proc checkForCam()
{
//initialize check at 0 because usually dag object won't be a camera
int $isCamera=0;
//check history
string $history[]=`listHistory`;
//if history object is a camera, change camera check to 1.
if (`nodeType $history[0]` == "camera")
$isCamera=1;
//if check is 1, rebuild camera list
if ($isCamera)
rebuildNewCamList($history[0]);
}
//parent scriptJob to bookmarkWindow, so it gets killed when window get closed
scriptJob -event "DagObjectCreated" "checkForCam";
scriptJob -e "NameChanged" "checkForCam";
i only wonder about deleting the camera. How would i know?
Not a good way to check what's already in the scene either...
CGTalk Moderation
03-01-2007, 11:00 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.