Material visibility
almahiedra
Posts: 1,351
Is there a method to know if one of the materials of a node does not appear in the camera being rendered?
This serves to check the visibility of a node:
Scene.getNode(j).isVisible()
I imagine there is an equivalent for materials, but I don't find it.
In my case, I want to know if the materials of node j are exposed to the camera, since I have a scenes with 300 materials and the process on each material takes some time, so it makes no sense to include materials that are off-camera or that are hidden due to a pose.
Thanks in advance.
Comments
Not rally, since surface settings are not a simple on/off
I don't think isVisible() does what you think it does, it does not report if a node is in a cameras field of view, it reports if a node is toggled visible or not (the eye icon in the Scene Pane. The other isVisible*() methods are similar.
It this is actually what you looking for, then the answer is materials do not have a visiblity setting. The closest thing would be if opacity is set to 0 or not.
It is difficult to calculate if something affects the current field of view of a camera because of reflections; you have to render the scene first and record extra information which would be slower and take more memory before you can know if something has no effect, which defeats the purpose.
Thank you both for the answers. So, for now, I only have the way of rendering by groups of materials and not one by one.
In other hand, can I determine if a material has been selected? For nodes it is posible to do the list, but I don’t find an equivalent of getSelectedNodeList for materials. Is there such a thing?
DzMaterial::isSelected() is what you are lookin for.
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/material_dz
¡Chévere! :)
Thanks!