PDA

View Full Version : expressions help



xchrisx
04-05-2008, 10:14 PM
is there a way to have an expression reference the object that it is contained in? for example... I have a character uses the following expression:
clamp(Character.LT_Arm_Upper.rot(Time).h, -10, 5)

Now if I load in a second character and animate the first characters LT_Arm_Upper it moves them both. So I am looking for a way to make these expressions use only the mesh that they are contained in. So LT_Arm_Upper in character 1 moves character 1, and LT_Arm_Upper in character 2 moves character 2.

Or if anyone knows a work around im all ears.

-c

ps- the only solutions i have been able to think of is saving out copies of the meshes then manually changing the expressions per character (which would really suck and be time consuming). Other than that I think I could use follower, but then I wouldnt have access to the clamp function.

UnCommonGrafx
04-06-2008, 06:13 AM
If you use Relativity as your expression engine, then this can be done using the SELF reference.
If you don't have 9 or Rel, then no, there is no self-referential code in the built-in system. {Hope someone corrects me on this if I'm way off the mark.}

evenflcw
04-06-2008, 07:40 AM
Was the expression assigned to Character.LT_Arm_Upper.rot.h? In that case you could use the only self referring reserved word available in vanilla LW native expression engine - Value. Value corresponds to the value of the channel the expression is attached to.

clamp( Value, -10, 5 )

xchrisx
04-06-2008, 01:46 PM
uncommongrafx: thanks, i will look into relativity a bit more. guess its time to learn that expressiong language too :)

evenflcw: the expression was actually tied to a seperate bone that was controlling a piece of shoulder armor.

xchrisx
04-06-2008, 02:17 PM
here are some expressions I have tried with no success:
Wont work because of multiple lt_arm_upper's in the scene P(lt_arm_upper,t)
Reference's its own channels for another channels rotation not another's rotation. P(SELF,t)
No longer works if another "character" object is loaded. CHAN(character.lt_arm_upper.rotation.p,t)

still no luck as of right now. anyone got any ideas? attached i have remade a simple scene to test the expressions. the expressions are on the "ShoulderArmor" bone.

thanks in advance
-c