Message 1 of 2
Gobal scripted attributes doesn't update to new def when loaded

Not applicable
01-25-2011
06:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi,
I'm trying to use a global scripted attributes (with attribID) to store variables in the rootnode, instead of using persistents globals.
I'm having problem with updating the definition.
When i update it using the same name and attribID, and then load a scene with the old one, i'm expecting it to update to the new one. But instead, the old def overide the new one !
Here step by step what i'm doing:
create attribute def:
add attribute to the scene root:
save the scene. close it.
update attribute definition:
reload old scene: Old definition is not updated, instead it is loaded and replace the new one.
Here what is said in the maxscript reference:
I'm trying to use a global scripted attributes (with attribID) to store variables in the rootnode, instead of using persistents globals.
I'm having problem with updating the definition.
When i update it using the same name and attribID, and then load a scene with the old one, i'm expecting it to update to the new one. But instead, the old def overide the new one !
Here step by step what i'm doing:
create attribute def:
global myAttrib = attributes myAttrib attribID:#(0x6b59619, 0x1f35b5f2) version:1
(
parameters params
(
param1 type:#string default:"name1"
)
)
add attribute to the scene root:
custattributes.add rootnode myAttrib
save the scene. close it.
update attribute definition:
attributes myAttrib attribID:#(0x6b59619, 0x1f35b5f2) version:2
(
parameters params
(
param1 type:#string default:"name1"
param2 type:#string default:"name2"
)
)
reload old scene: Old definition is not updated, instead it is loaded and replace the new one.
myAttrib.source
"attributes myAttrib attribID:#(0x6b59619, 0x1f35b5f2) version:1
(
parameters params
(
param1 type:#string default:"name1"
)
)
"
Here what is said in the maxscript reference:
Whenever you evaluate an attributes definition with a particular attribID: you will update all objects that have custom attributes based on that definition, and loading objects with attributes of that attribID will update themselves to the current definition.