update problem with scripted operator

Discussions concerning programming of SOFTIMAGE©
Post Reply
nicoM
Posts: 21
Joined: 10 Jun 2009, 11:24

update problem with scripted operator

Post by nicoM » 07 Oct 2011, 01:12

Hi all,

I have some update Problem with my scripted operator.
I have build on a custom parameter a scripted op where I change the file path of a referenced model on every frame.
I use the SetValue Approch to change the Path (jScript: SetValue("RefModel.file", "Models\\YourModel.emdl", null); )
The scripted op works when I leave the property page open of custom parameter.
But when I close the property page there is no update anymore.
And when I try to render a sequenz .... no update of the scrited operator.

Any Idea how to solve this?

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 11:02
Location: Montreal Canada
Contact:

Re: update problem with scripted operator

Post by xsisupport » 07 Oct 2011, 11:16

You shouldn't be using commands in an operator. An operator is supposed to be updating a connected port. If you're not using an output port, then it seems to me that you're bypassing the whole evaluation mechanism of Softimage.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

nicoM
Posts: 21
Joined: 10 Jun 2009, 11:24

Re: update problem with scripted operator

Post by nicoM » 07 Oct 2011, 12:29

I did it expected that this could be the problem...

I tried a second approach where I create an event plugin which triggers on siOnBeginFrame.

My code use the same comand to change the path .... but nothin happens!!

If I run the script solo .... it works!
But in context of the event plugin .... nothing!

Here is the code I inserted in the event plugin:

Code: Select all

// 	TODO: Put your code here.
Myload = GetValue("control.loading");
if (Myload == 1)
{
	InFrame = GetValue("control.currFrame");
	inMax = GetValue("control.MaxModells");
	LogMessage("Hallo");
	if (InFrame <= inMax)
		SetValue("M1.file", "Models\\M" + InFrame + ".emdl", null);
	else
		SetValue("M1.file", "Models\\M" + InMax + ".emdl", null);
}

It reads three variables from a custom parameter set and set the comand to change the file path of the referenced model.

Any idea?

Thanks
Nico

User avatar
CiaranM
Posts: 87
Joined: 09 Jun 2009, 01:37
Location: London
Contact:

Re: update problem with scripted operator

Post by CiaranM » 18 Dec 2011, 01:27

Hi,
are you sure that's the event you want to use? siOnBeginFrame is fired when a frame begins to render. Maybe you should try siOnTimeChange which fires whenever the timeline changes?

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests