View Full Version : how to save object self,in Attributes?
if use
TestAtt = Attributes "TestAtt"
(
Parameters Main
(
thisNode Type:#Node
)
)
TheBox = Box()
CustAttributes.Add TheBox TestAtt
TheBox.Testatt.ThisNode = TheBox
then
-- Runtime error: Assignment failed, possible dependency loop,
|
|
labbejason
10-19-2009, 03:40 AM
Not sure if there's a way to set #node directly to itself but you could always use weak references:
TestAtt = Attributes "TestAtt"
(
Parameters Main
(
thisNode Type:#maxObject
)
)
TheBox = Box()
CustAttributes.Add TheBox TestAtt
TheBox.Testatt.thisNode = (nodeTransformMonitor node:theBox)
Access it by:
TheBox.testAtt.thisNode.node
Maybe someone else has a solution with #node :)
AFAIK #maxObject with weakreference is the only and the best way, without creating circular dependencies.
-Johan
CGTalk Moderation
10-19-2009, 07:27 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.