[Closed] different AnimHandle for the same object ?
Hello,
I have a strange issue here. From what I understand in the documentation, AnimHandle are supposed to be constant during a 3dsmax sessions.
So, when I decided to play with .NET TreeViews, I used that handle to store in the Tag property of each TreeNode the matching Node. So that I can get it later with GetAnimByHandle. The data to store is more condensed and, I think, the code is quicker to run.
However, when I get the Tag from any TreeNode, I have two strange things :
- handles have a letter at the end ??? (6364P for instance). I assumed it was the encoding of the integer… but still weird…
- handles is different from the one I get using GetHandleByAnim in the Maxscript Listener (cf. bottom)
- the difference between the two handles are only the last letter (I get 6364L from the Tag and 6364P from the Listener) and it is always letters P and L ending the handles
"handle to find : 6335P | $Box:Box003 @ [-49.936966,159.587921,0.000000]"
"handle current : 6335L | $Box:Box003 @ [-49.936966,159.587921,0.000000]"
Anyone can give me a flashlight to see anything clear in this ?
Thanks in advance
It’s the same handle, just a different datatype. In maxscript, this doesn’t matter, conversion happens automatically. An equality test in maxscript should return true.
P stands for Pointer, L stands for Long (a 64bit (unsigned) integer).
Ok Thanks !
As you said, here is a little code showing the equivalency:
treenode = DotNetObject "TreeNode";
treenode.Tag = GetHandleByAnim $Box001;
print (treenode.Tag); -- 3915L
handle = GetHandleByAnim $Box001;
print handle; -- 3915P
print (handle == treenode.Tag); -- true
Off topic PS :
Btw, to be honest, the idea of the anim handle stored in the Tag property of the TreeNode came, at first, from your Outliner source code :). Amazing gift to the community ! Thank you very much. It woud have taken me ages to understand maxscript subtilities you are dealing with in the Outliner sources.