sverchok icon indicating copy to clipboard operation
sverchok copied to clipboard

boolean activation/deactivation (show/hide) of mesh viewer

Open Sinasta opened this issue 3 years ago • 6 comments

I try to do an animation with sverchok. I have some Meshes that will appear and dissapear during the animation. I would like to know if there is a way of activating and deactivating the mesh viewer node or the polyline node? if i just switch the vertex list to a 0 / false value, the viwere node gives an error (logical behaviour). To say it simple i would like to have a boolean input node for the viewer nodes to simply parametrically activate and deactivate them. Thank you

Sinasta avatar Nov 24 '21 15:11 Sinasta

I tried to use get set property but i think this might not be the best way and it doesnt seem to work in blender 3.1

Sinasta avatar Nov 24 '21 15:11 Sinasta

Screenshot from 2021-11-24 16-12-59

Sinasta avatar Nov 24 '21 15:11 Sinasta

A visibility input socket, is one way to do this - arguably the tidiest! but the nodes don't have this feature. If more people are using sverchok for animations, it's something we should consider adding.

There are potential workarounds, which rely on the Object socket output of the Object Viewer nodes. You can pass the objects output from the Viewer to an Object ID Set node. and use the object's hide_render attribute.

image

The Object ID Set node will set the hide_render property for each of the objects it finds in the socketdata, to the desired value. If you just pass it a single False/True (from logic node) it will affect all of the objects the same way. You can also pass a list of values to selectively set the visibility for individual objects. (using 0 and 1, or lists like.. [[0 0 0 0 1 1 1 0 0 1]] if you wanted to hide just those four objects)

zeffii avatar Nov 24 '21 15:11 zeffii

or hide_viewport

zeffii avatar Nov 24 '21 15:11 zeffii

thanks a lot for the answer! Ill try that out. I would still apreciate a lot if that function would be integrated to the mesh viewer nodes. Maybe in a similar way like it is done for the Viewer node (with the attribute node)

Sinasta avatar Nov 24 '21 17:11 Sinasta

In the name of simplicity i'd like to avoid adding an attr node to obj viewer nodes - in the short term. The Object ID Set node provides adequate access to features, albeit more low level than the vd attr node. The downside is that you need to know how to find which properties (and their names) you can control. We could think about offering a nicer way to show available properties.

zeffii avatar Nov 24 '21 18:11 zeffii