Notifications
Clear all
[Closed] Custom new attributes?
Feb 09, 2017 3:04 pm
Hi,
So is there a way to set some new attributes to a node? Eg. $.newAttribute = “owesome”
4 Replies
Feb 09, 2017 3:04 pm
Yeah I know about that. But it does not worrk for me, I always get error:
-- Type error: custAttributes.add requires MSCustAttribDef, got: undefined
1 Reply
Perhaps you are not assigning your CA definition to a variable?
Try next code:
the_weaponData = attributes weaponData
(
parameters main rollout:params
(
hitPoints type:#integer ui:spn_hits default:10
)
rollout params "Weapon Parameters"
(
spinner spn_hits "hitPoints:" range:[0,100,10] type:#integer
)
)
sp = sphere()
custAttributes.add sp the_weaponData
the_weaponData2 = attributes weaponData2
(
parameters main rollout:params
(
hitPoints2 type:#integer ui:spn_hits2 default:10
)
rollout params "Weapon Parameters 2"
(
spinner spn_hits2 "hitPoints2:" range:[0,100,10] type:#integer
)
)
custAttributes.add sp the_weaponData2
Feb 09, 2017 3:04 pm
well you asked if there is a way to add new attributes and not that the way it exists is not working for you.
If you post a test script we can fix it for you, but what aaandres showed will work.