owl-project / NVISII

Apache License 2.0
327 stars 28 forks source link

More effective way to manipulate objects #117

Open LTU-Eimantas opened 3 years ago

LTU-Eimantas commented 3 years ago

Sorry for bothering you one more time. But it's necessary to finish my assignment. The thing is I am planning to train NN, more precisely your other project (DOPE) for AGV to detect carts and park under them. So I need 3D pose estimation for primary detection and finish parking with other sensors. The thing is I am reading NVISII documentation and I see you can only import objects using nvisii.import_scene or nvisii.entity.create. With nvisii.entity.create I can easily manipulate objects whatever I want, but I can't use materials with it, only maps. With nvisii.import_scene I can't manipulate my object after creating it ( I know it's made from a lot of meshes). So is another way to import an object who has a lot of meshes and manipulate it as one object after importing? For now, I am deleting and reimporting scenes and creating training data, but it's really time-demanding.

natevm commented 3 years ago

Hi,

entities allow for setting a material component, so indeed they do support materials. you would need to construct these components manually (transforms, meshes, materials, textures, etc)

scenes (ie, collections of objects, materials, transforms, lights, textures, etc) are required for importing complex files (obj files often describe multiple simultaneous objects and materials). Objects within a scene can all be moved simultaneously using the root transform (ie the first transform in the list of transforms within the scene object returned by import_scene)

This root transform for a scene can be accessed using scene.transforms[0].

LTU-Eimantas commented 3 years ago

Yeah sorry with entities I have in mind one entity one color one material. Taking about scene.transforms[0] it was really helpful to move all of it. I think you should make a separate function or document it (make an example in the example folder) because it is really useful to move the whole thing at once when making training data. Thank you for your help.

natevm commented 3 years ago

Agreed, this needs documenting… to be honest, the scene API is still a bit of a work in progress. At first we were only using that api to load single scene files, but more and more we’re using it to import collections of components, so I’m thinking of renaming the returned object from “Scene” to “Collection” and then swapping out “nvisii.import_scene” with “nvisii.import_collection”. Import_scene would remain for a while as a legacy function to avoid breaking too many projects during the transition.

That collection might then have an explicit field for the root transform, which would be documented along with the rest of the “Collection” object.