I’m trying to merge multiple files through script into a scene file. I need to perform actions on these objects after they are merged. Does anyone know if there is a way to determine what file objects came from after they are merged? Is there is a way to add a namespace or group of the filename to the merged objects?
Yeah I got that far. I need the object names themselves to contain the filename so I can afterward run a search and perform actions on only those objects that I merged. It sounds like preping the file beforehand is the best you can do.
I’m sure there is a way, give us all time I’m sure someone will come up with a method. I’ll see what I can’t figure out. You may need to add an input pop up that let’s the user define the file name that needs to be used. Then you can also have that added to the file. I know there is a sample script that allows you to select models with name containing substring.
The way to get started is to quit talking and begin doing. ~Walt Disney
Cool. Yeah the problem is if you have a bunch of objects in your current fbx scene then you merge another fbx scene, there is no way to distinguish the merged objects from the objects that were already in the file. You can get the filename from a user input but you would still have the problem of not knowing which objects to attach it to.
What you could do is create a temporary namespace for all of the objects in the scene, then merge the file, then look for all the objects without a namespace, then attach the file namespace to those objects, then remove the temporary namespace. Seems like that would work but would be slow.
I can’t see any ready to use method. The solution you have presented look ok for me, but I do not know why you what to remove temporary namespaces? Speed of this solution can be reasonable I think, if we can find a good method for find objects without namespace. So it depends if you are intrested only in model or in all kinds of components that can be merged? If only models, we can only check parent models, becouse it’s childs will also have same namespace applied.
Thanks, thats a good idea. I am dealing with just models. If i could loop through just the root models it would be a lot faster and I could add a namespace to the merged models entire hierarchy. I think ill try that.