Hi Mathieu,
You have complete access to the XSI scene from a custom FXTree node. I used
it in my PostLight plugin; the user could type the camera name into an edit
box. Here's a picture of the interface:
http://www.andynicholas.com/thezone/content/download/postlight/PLightCam.gif
This is the code I used to get hold of the camera position, and I'm sure you
could modify it to your own needs:
void PostLightData::GetCamera(const wchar_t * cameraName)
{
XSI::Application app;
XSI::CString camName(cameraName);
camName+=L".kine.global";
XSI::CRef ref;
ref.Set(camName);
double pos[3]={0,0,0};
if(ref.IsValid())
{
XSI::KinematicState kine(ref);
XSI::MATH::CTransformation& xform = kine.GetTransform();
xform.GetTranslationValues(pos[0],pos[1],pos[2]);
}
camPos.x=(float)pos[0];
camPos.y=(float)pos[1];
camPos.z=(float)pos[2];
}
To be honest, it doesn't sound like a good idea to try to write to a
UserDataBlob. It goes against the FXTree paradigm and I think you'd end up
causing more problems than you'd solve. However you should probably take a
look at the "ufoProcessGetRasterInAtFrame" function which should allow you
to analyse all the frames of each sequence. Just make sure you check out the
docs, since you have to handle it carefully to avoid using too many
resources.
Andy
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of
Mathieu Leclaire
Sent: 04 October 2006 17:28
To: XSI(at)Softimage.COM
Subject: doing something different with Custom FX Operators
Hey guys,
I'm trying to do something a little different here so bear with me... I'm
doing a plug-in that will analyze 2 image sequences and the scene camera's
transform to output 1 image. So 2 image sequences + 1 animated Camera = 1
single output image.
First, I need to figure out how to pass scene information to the custom FX
operator. In my case, the FX operator needs to know the camera's
transformation matrix and I also want to use XSI classes like CTransform to
do some calculation inside my custom FX operator. How do I do that? How can
I make the link?
Second, I need to analyze the whole sequence before I can create my final
output image. So instead of outputting to an image format, can I output to a
custom data structure like a userDataBlob or something similar that would
then be used to create the final image?
Any pointers or suggestions you guys can give me could end up being very
useful. So please let me know how you would approach the issue. Thanks.
Mathieu Leclaire
R&D Programmer
Hybride Technologies
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi