Can an Object in second scene be parented to an Object in first scene?

I have an object that needs to be in another scene so that the lighting only affects it and not the others. However, I need this object to be a child of an Object in the other scene… When I add it, it ends up back in the scene that it shouldn’t be in…
Is there a way to accomplish this? To maintain the parent/children hierachy, but have the objects in separate scenes?

Objects can only have one hierarchical parent so the simple answer is no but there are workarounds depending on the case, are you simply trying to preserve transformations such as rotation and position? or something more complex?

It sounds like you might want to render the same scene twice, rendering different layers each time?

1 Like

The objects are nested, and can have various scaling/rotation/position in the objects… I’m trying to render a skeleton inside the objects, and the skeleton will be lit differently from the objects.

I’m trying to do that, however, I need the objects to render in front of everything else(and lit differently)…
They need to maintain the same position/rotation/scaling of the nested objects, etc… So they need to be in the same scene…
What I have done now is place the light in a layer, and switch the camera to the layer and render a second time… I also clear the depth buffer…
This doesn’t render the Bone objects in front however… so I set their material to depthTest: false, and deptWrite: false… however, then they are seen through each other(the bones should be opaque and block other bones from view, but I am seeing bones behind other bones)… so that doesn’t appear to work…
I’ve also tried setting the renderOrder of the bones higher, but I can’t get them to render infront while staying opaque.

actually, maybe the bones aren’t rendering in the second pass… I need to check.

Okay, so if an object is in layer 4, and light is in layer 4, and camera is in layer 4… the object doesn’t get lit… I’m not sure why.

They get rendered in the second pass, but no lighting, even though their layers are all set to 4 (camera, light, objects).

EDIT: nevermind… I had the lights in a group, and the group layer was set to 4… Apparently the lights themselves have to be set to layer 4.

Okay, I managed to get it working using layers. I just had to make sure everything was set to the layer, and not just a group of objects.

1 Like