iimachines / Maya2glTF

Maya to glTF 2.0 exporter
MIT License
326 stars 49 forks source link

Strip namespaces #143

Closed 1fth3n3ls3 closed 3 years ago

1fth3n3ls3 commented 4 years ago

Hi, I've been checking the options on export to find out if there is a way to do this. The only thing I found closer to this tag -disableNameAssignment but not exactly what I need that is to delete in naming all before the colon (colon included). In maya I can't do that if objects are references (AFAIK). Edit the exported file is not an option also, I think, because I need to generate a binary file (glb), and I have doubts I can do that in this format. I think this is something really common when you export things in maya. Namespaces avoid clashes in names in the scene but that's not something you need (all the opposite) when you export your assets. I don't know if there is a chance that a feature like this could be implemented in future revisions. That would be really appreciated.

ziriax commented 4 years ago

Great idea! I also struggly with these long names for debugging. Will look into this during the weekend. Please ping back if this isn't resolved before Friday November 13th (that sounds scary :wink:)

1fth3n3ls3 commented 4 years ago

Hey, just pinging back : ). I hope this feature is not giving you much trouble. Thanks again!

ziriax commented 4 years ago

Ouch, completely forgot about this, too much work 😉 Will look into it.

ziriax commented 4 years ago

Almost ready, testing. This will become the default. If you want namespaces in the glTF names, you can pass the flag -kon or -keepObjectNamespace

ziriax commented 4 years ago

Would you be so kind to test the v1.2.1 release?

This should remove the namespaces form the names

https://github.com/iimachines/Maya2glTF/releases/tag/v1.2.1

1fth3n3ls3 commented 4 years ago

Would you be so kind to test the v1.2.1 release?

This should remove the namespaces form the names

https://github.com/iimachines/Maya2glTF/releases/tag/v1.2.1

Thank you very much, with this new feature I will be testing intensively the exporter, so I will let you know how it's going everything. Thanks you!

1fth3n3ls3 commented 4 years ago

Hi, I did a few test and it works FLAWLESSLY the namespaces are stripped (really a big relieve to be able to get rid of them), and so far I didn't notice anything wrong.

One thing I notice, but I think it's not related to this version, it's that the exporter doesn't export if I try to export only deformer nodes without meshes. That's something normal if your are exporting only animations. But in this case, the animation doesn't get exported and you get a file of only 1kb. I'm not sure if this dependency on deformed meshes is the intended behaviour or not. I also can think of other use case when you don't even had any mesh to export, for example a camera animation. I also notice, even if I export deformed meshes, some nodes that are not related to the skincluster they don't get exported.

ziriax commented 4 years ago

Thanks for testing!

So if I understand you correctly, you expect the exporter to export the mesh connected to a deformer node, even if only the deformer node is selected, not the mesh itself?

I guess that can be done, currently I just remove all nodes from the selection that are not meshes or cameras... If a deformer node is selected, I could internally select the mesh itself.

But you are right that this is indeed by design.

1fth3n3ls3 commented 4 years ago

I'm sorry, I explained myself really poorly, I apologize for that. I'll try to put a clearer example. Lets say I try to export a selection of nodes that can be deformers of a mesh or maybe not, locators or joints, who control the position of an effect or trail added later in the engine. If I try to export only this nodes they don't get exported. If, like you explain, this nodes are excluded buy design, it would be nice a flag could avoid this intended behaviour and allow the exporter to export all nodes selected without exclude anything from this selection. I hope know it makes way more sense, if not, please let me know.