PDA

View Full Version : Custom Attribute Versions


AndreasHackel
01-23-2008, 08:44 PM
I have a big problem concerning global scripted custom attributes (the ones with attrib ID): Let's say you create a simple custom attribute and assign it to on object save it and xref it into another scene. It works well as long as there are no objects with a newer version of this attributes in the scene. If this is the case the new version will be replaced by the old one!

Does anyone know a way to prevent max from replacing newer custom attribute version so that the latest version is always kept?

Many thanks
Andreas

PEN
01-23-2008, 09:01 PM
I have a big problem concerning global scripted custom attributes (the ones with attrib ID): Let's say you create a simple custom attribute and assign it to on object save it and xref it into another scene. It works well as long as there are no objects with a newer version of this attributes in the scene. If this is the case the new version will be replaced by the old one!

Does anyone know a way to prevent max from replacing newer custom attribute version so that the latest version is always kept?

Many thanks
Andreas

You need to make the ca def unique so that it doesn't get updated.

AndreasHackel
01-23-2008, 09:33 PM
Thanks, that's not exactly what I want, but it could work. But how do I convert the unique attribute back into an non unique one of the latest version so it gets updated by new versions? I could remove the custom attribute from all objects and add a new one but that would kill all the values.

PEN
01-24-2008, 12:09 AM
Ah so you want the object that is being merged in to take on the definition that is already in the scene?

I think that you would have to set up a callBack and on post file merge get all the defs in the scene and update the ones that you want. Problem here is if there are params in the current scene def that are not in the incomming def they will be lost and then replaced and so will any animation on them. So I think that they only is to update the defs before the merge.

AndreasHackel
01-24-2008, 07:03 AM
So there is no way to prevent an attribute from being updated? I already included an "on update" event in the attribute definition which tells me whenever a version is "downgraded", but until now I didn't find a way to stop the updating at this point.

apocalypse2012
01-24-2008, 09:40 PM
Sadly, no you can't stop the updating. For custom attributes, load time is evaluation time. The custom attributes will be updated no matter what the version number. Also, making the custom attribute unique can also be problematic, depending on how many custom attribute instances you are talking about.

Every custom attribute has a definition. When you make a CA unique, it instantiates the definition. These definitions do not automatically garbage collect when you delete the attribute, so you can end up with alot of cruft if you don't manually delete the definitions.

Ultimately, the versioning system that custom attributes inherit from scripted plugins is broken in custom attributes.

CGTalk Moderation
01-24-2008, 09:40 PM
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.