View Full Version : Getting COFFEE script to work on a render slave
Scott212 03-09-2008, 09:51 PM The premise of the code is to take an animated camera and add offset values on top of the previously animated keyframes. So, what I'm doing is creating a new camera and through an expression tag plugin, copy the values over to the new camera from the animated one. Code-wise, I'm using the GetData methods and SetData methods to get/apply the values to the container. When I'm done setting the values, I'm using the SetContainer to apply values to the camera.
Updating in the viewport shows that this works just fine as well as interactive rendering. However, when rendering on a slave machine running the -nogui flag, the new camera doesn't get the values.
What do I need to do here? EventAdd? obj->Message(MSG_UPDATE)?
|
|
Scott212
03-10-2008, 06:08 PM
What am I missing here, the renders still just sit there while the real camera moves as expected.
Here's a code snippet to support what I'm trying:
MyExpTagPlugin::MyExpTagPlugin()
{
super();
this_cam = GetObject();
}
MyExpTagPlugin::Execute(doc,op)
{
// Position / Rotation / Scale
this_cam->SetPosition(orig_cam->GetPosition());
this_cam->SetRotation(orig_cam->GetRotation());
this_cam->SetScale(orig_cam->GetScale());
// Object Attributes
var this_cam_bc = this_cam->GetContainer();
var orig_cam_bc = orig_cam->GetContainer();
this_cam_bc->SetData(CAMERAOBJECT_APERTURE, orig_cam_bc->GetFloat(CAMERAOBJECT_APERTURE));
var orig_cam_foc = orig_cam_bc->GetFloat(CAMERA_FOCUS);
// ...etc...
// MAKE IT SO
this_cam->SetContainer(this_cam_bc);
this_cam->Message(MSG_UPDATE);
EventAdd();
}
My only thought is that perhaps it's because I'm using the GetObject() method to get the camera vs using the 'op' var that's provided?
Maybe check on plugincafe
Cheers
Björn
Scott212
03-10-2008, 10:22 PM
Got it! (Thanks for the help, Rick) I wasn't using the document object correctly. I should have been using the supplied doc variable since when running the -nogui flag, GetActiveDocument() doesn't supply the correct document.
CGTalk Moderation
03-10-2008, 10:22 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.