PDA

View Full Version : Clone object (1) (2) (3) etc



wrightyp100
05-11-2017, 08:25 AM
Hi Guys,

Hope everyone is well.

long time no see. I have a question. I would like to clone objects but not have layout add (1) to the original. Is that possible?

Any help would be fab. Ta.

Paul

Danner
05-11-2017, 08:39 AM
What exactly are you trying to accomplish? Whould instancing work?

wrightyp100
05-11-2017, 09:11 AM
Hi Danner.

Unfortunatley still using 9.7.

So, i'm using lightwave to produce a button panel for a bespoke game engine. We put textures on flat polys and it doesnt really get any more complicated than that. The only thing is if you want to duplicate your layer tree, lightwave adds '(1)' to everything and not just the subsequent clones, which changes the name of the object and therefore renders the programmers code useless unless they go through and rename everything.

Does that make sense? :/ Hopefully.

Danner
05-11-2017, 09:46 AM
I don't think you can. this is what I know about the subject.

If you make a simple scene, just add an object and clone it. Lightwave adds the numbers in parenthesis to differenciate between them and they are displayed as such in the scene editor. But this is not saved with the scene. If you inspect the scene file, those numbers are not part of the scene, they are just a way to display the copies once loaded. They get called from the model individually by layer number, not by name. Now when you export the scene to an engine using FBX, the layer names do get exported as part of the FBX. In Layout you cannot have two objects named exactly the same (as far as I could tell) but in Unity, for example, you can, but cannot edit the base fbx layer names. Only the ones instanced to the scene.

wrightyp100
05-11-2017, 10:01 AM
That all makes sense. Just a pity it doesnt rename the clone and not the original object. Booo. Anyway, thanks for the help :)

MonroePoteet
05-12-2017, 09:35 AM
I would think the program that applies the textures to the flat polys could be modified to take Item indices into account. If it's LScript, LScript provides strleft(), strright(), strsub(), parse() and integer() functions which would allow finding and extracting the index of each cloned item, and use the index to apply the appropriate texture. Of course, C, C++, and Python also provide string extraction and manipulation tools.

mTp

Kryslin
05-12-2017, 10:23 AM
Even simpler is using Regular Expressions in lScript. Yes, it may look like some arcane mess, but it works.

My rename lScript uses regular expressions to do search & replace, and also to strip (n) those autogenerated numbers before renaming...