PDA

View Full Version : pb with regexp



samyc
12-12-2008, 02:09 PM
Hello,
I make a loop on the bones of an object and I want to do some special treatments on GIMBAL bones so I wrote:

expr = regexp("^GIMBAL");
if(bone == expr)
{
... but I never go here!!!!
}

can someone tell me where is my error?

Hopper
12-12-2008, 03:55 PM
Hello,
I make a loop on the bones of an object and I want to do some special treatments on GIMBAL bones so I wrote:

expr = regexp("^GIMBAL");
if(bone == expr)
{
... but I never go here!!!!
}

can someone tell me where is my error?
That code should work, however, set your current frame to 0 and see what that does for you.

currFrame = 0;
mesh = Mesh();
bone = mesh.bone();

If you're not sure you are getting the bones, in your loop do an info on it.

info ("Bone: ",bone);
bone.next(); (etc...)

samyc
12-12-2008, 04:15 PM
Thank you!
After some time I found out that I had to write
...
if(bone.name == expr)
...
:-)

Hopper
12-14-2008, 08:44 PM
Thank you!
After some time I found out that I had to write
...
if(bone.name == expr)

That's odd. Even the reference doesn't use property notation to access the name field. I was actually looking for a list of members for the bone object and didn't see any reference to "name" at all. Just referring to "bone" itself should have done the trick.

Nice find. I'll have to make a note of that one just in case.

samyc
12-18-2008, 12:36 PM
Is there a list somewhere of methods we can use for bones?
ex: getPosition(..), getScaling(..), etc...
by the way how do we use restparam(state)? I tryed restparam(POSITION) but the syntax doesn't seems ok...
Cheers,