MaxScript and C# value rounding

Jul 3 '12

Comments: 0

MaxScript and C# value rounding

So I ran into an interesting problem last month thought I would share my findings with everyone. For our skeleton joints that don't have a parent joint we use the max value of a long which is 4294967295. The morpheme animation engine and compiler will interpret the joint not having a parent in the engine with this value. I would think something like -1 would be little more simple than trying to remember the max value of a long, but that would require a big change to the animation engine which won't happen anytime soon. The meat of the problem is when you try to assign a C# long type property 4294967295  in MaxScript it will do a cast behind the scenes and the property value will end up being 4294967296. I ended up just creating an overloaded constructor that sets the value in C# only so no casting can happen and the problem was fixed.

Related Posts

Leave a comment

Your email address will not be shared or published. Required fields are marked *

Top