PDA

View Full Version : Keeping track of merged objects


Hobbs
06-20-2007, 03:40 PM
Is there anyway to tell where a file has been merged from, say long after it has been merged?

I ask because i have have a tool that currently stores up to 8 objects, and then can place them as Xref objects or as Mesh objects on a given node. The way our current engine runs is that it is best to have instances if an identical object is already in the scene...so my script looks for existing copies before it places the objects.


The problem I run into is when objects are named the same or very similar. I have this problem solved with Xref objects by looking at the .filename of the objects and comparing them.

The problem i am running into is when placing as a mesh. I have, to my knowledge, really no way to compare the objects. I was thinking i could look at the location of the material..but then i would have to merge in the object first before i could check the material location, and this just seems like extra calculations for me that i'd rather not add.

Does anyone have any suggestions on how to proceed, or has anyone come across this problem before?

Thanks

davestewart
06-20-2007, 04:11 PM
If you use a callback on the way in, you could storethe value and retreive it later:
fn addOriginalDirectoryUserProp =
(
for obj in (getCurrentSelection()) do setUserProp obj "original_directory" sysInfo.currentdir
)

callbacks.removeScripts id:#cbAddOriginalDirectoryUserProp
callbacks.addScript #filePostMerge "addOriginalDirectoryUserProp()" id:#cbAddOriginalDirectoryUserProp
Is that what you're after?

Hobbs
06-20-2007, 04:15 PM
I had thought of doing something like that...but we use userproperties in our engine, so if it doesn't recognize something it could possibly crash the game. So unfortunately thats out. :sad:

davestewart
06-20-2007, 04:55 PM
Custom attribute then...

CGTalk Moderation
06-20-2007, 04:55 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.