dicarlolab / ThreeDWorld

Generator of interactive Unity-based 3D environments with physics
Other
21 stars 4 forks source link

Why do objects instantiated from some prefabs not have renderers attached? #11

Closed yamins81 closed 8 years ago

yamins81 commented 8 years ago

@sharatb Some objects like the one called "Rack" do not have renderers attached when they are instantiated. I'm just wondering why this is the case.

sharatb commented 8 years ago

I'm guessing it might be because those are Complex Semantic Objects that are made up of child Semantic objects that have renderers attached. There may also be some other assets that have multiple child mesh nodes with renderers(even if they are a simple object with only one rigidbody).

On 3/7/2016 6:40 PM, Dan Yamins wrote:

@sharatb https://github.com/sharatb Some objects like the one called "Rack" do not have renderers attached when they are instantiated. I'm just wondering why this is the case.

— Reply to this email directly or view it on GitHub https://github.com/dicarlolab/ThreeDWorld/issues/11.

yamins81 commented 8 years ago

Got it thanks.

yamins81 commented 8 years ago

@sharatb This is a related issue -- not sure exactly what it tells us but does suggest something needs to be fixed somewhere ....

here's an image produced by the system: im2_11

here's an image of the same shot rendered with the new "GetIdentity" renderer (that I've committed to the "dan" branch). (The GetIdentity renderer renders an image with a color based on the ID of the material associated the object's renderer, which is just set to increment as objects are added during procedural generation.)

figure_3

You can see that there are weird things, like the pool cue balls totally fail to show up, as do some parts of some of the objects, e.g. some of the lamps. This is happening because the system does not think those points are covered by an object that has an associated renderer.

This probably does have something to do with a hierarchy of child objects, like you said. Do you suggest a fix? Like looking up/down the hierarchy in some way? Does the SemanticObject class provide a framework for doing this?

sharatb commented 8 years ago

You probably want to use obj.GetComponentsInChildren(); instead of just GetComponent. Though keep in mind that the way you have it set up it won't be separately identifying the parts for complex objects. If you wanted to do that that, you'd first want to do obj.GetComponentsInChildren() and then find all the renderer's under each object. -Sharat

yamins81 commented 8 years ago

this issue has been resolved by the fix that @sharatb suggested