How can one show render to default camera?

I got some nodes under render that are per-camera hidden and I’d like to have them to show, so I tried:

render.show()
render.show(232-1)
render.showThrough()
render.showThrough(2
32-1)

But none of the above work. render.ls() show those nodes with (per-camera hidden) tag. render.writeBamFile confirms the nodes are there (I can see them with pview).

try this

for np in render.findAllMatches('**'): np.show()

though it looks a bit hacky

Sadly, it doesn’t help. The model is still not there.

And this variant?

for np in render.findAllMatches('**'): np.show(BitMask32.allOn())

For the record, show() is equivalent to show(BitMask32.allOn()). It’s just a short-cut.

Just calling show() on a parent node should show everything. If you’re calling it on a child node you would need showThrough(). Are you sure your nodes are still hidden after doing this? Maybe they don’t show because of a different reason?

Not quite, at least for me
code:

m = render.attachNewNode('test')
m.hide()
render.show()
render.ls()
for np in render.findAllMatches('**'): np.show()
render.ls()

and result:

PandaNode render S:(CullFaceAttrib RescaleNormalAttrib)
  ModelNode camera
    Camera cam ( PerspectiveLens )
      PerspectiveLens fov = 39.3201 30
  PandaNode test (hidden)
PandaNode render S:(CullFaceAttrib RescaleNormalAttrib)
  ModelNode camera
    Camera cam ( PerspectiveLens )
      PerspectiveLens fov = 39.3201 30
  PandaNode test

Drat, you’re right. It would appear there’s no way to override the effects of a hide() that was specified on a child node, except by your suggestions.

Turns out that my camera wasn’t reparented to render, that’s why it wouldn’t work!

You shouldn’t have to do all of that to get the render world to show in your Panda3D camera. You may not be seeing the model because your camera isn’t positioned correctly to see the model. Try this code:

panda = loader.loadModel("models/panda-model")
panda.reparentTo(self.render)
panda.setScale(0.005)
panda.setPos(0, 0, 0)

self.camera.setPos(0, 10, 0)
self.camera.lookAt(panda)

I believe you can hide and show models by doing NodePath.show() and NodePath.hide(). By default, the model is shown when it is created like it is in the code above. Let me know if you aren’t able to see it. I hope this helps.