Jump to content

Questions About Evalstring


Recommended Posts

Hi

I've got a couple of questions about evalString, first off what are the

last two parameters(int vi and float t) suppose to represent/ control

void evalString(UT_String &val, int pi , int vi, float t);

void evalString(UT_String &val, const char *pn, int vi, float t);

my second question is about int *pi in the following:

void evalString(UT_String &val, const char *pn, int *pi, int vi, float t);

What does it represent and when would you use instead of the other two?

Many, Many, thanks

L

Edited by doc
Link to comment
Share on other sites

As I understand it (and I may be wrong) float t is time - ie in channels that can be keyframed it tells the eval function when on the timeline to evaluate the parameter.

I don't think you can key frame strings so I'm not sure if its their just for possible future compatibility, i always set it to 0.

int vi is the component you want to evaluate - ie in a 3 float vector it would be 0, 1 or 2

Again in a string I'm not sure you can have more than 1 component so again I always set it to 0.

As for your second question, I'm not sure... sorry

Link to comment
Share on other sites

my second question is about int *pi in the following:

void evalString(UT_String &val, const char *pn, int *pi, int vi, float t);

(extracted from OP_Parameters.h)

*****

vi : vector index

pi : parameter index

pn : parmeter name

v: vector component (if v == -1, all components are affected)

*****

If you know the parameter index, it might be faster to use it for the lookup, rather than the parameter name. But, unless you're doing this thousands of times, it's probably not worth it.

Cheers!

Edited by rjpieke
Link to comment
Share on other sites

You should always pass the proper time when evaluating parameters even though most legacy code didn't. Even in H8, it could cause cooking problems. For example, if your string parameter uses vtorigin() for some reason, then it will return the result at time 0 instead.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...