Expression for node evaluation mode display vs render

   5647   10   1
User Avatar
Member
30 posts
Joined: 1月 2015
Offline
Hello everyone,

Is there a variable or a function callable in an expression to query if the evaluation is done for display or for render?

Let's say I want to change a parameter value depending on if it is displaying in the viewport or rendering. How should I do that?

I know I could duplicate my node and put it in a parallel branch and set the render flag, but this forces me to manage more nodes in the end and makes the graph more complex.

Thanks in advance
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
Hi,
Typically the work flow I use for managing huge scenes of nodes is to use pattern matching and bundles. There is no need to care about the display flag at all.
In the mantra rop > objects tab you force the objects you want to render. The bundles are set to be smart and use the pattern match & filter to pull the node into the bundle. You can then expand this work flow using Python to pre roll your mantra rops and bundle system which can then be pushed as a default.

Rob

Attachments:
bundles.hip (196.2 KB)

Gone fishing
User Avatar
Member
30 posts
Joined: 1月 2015
Offline
Thank you for your answer circusmonkey!
I'm new to Houdini and I do not master bundles yet, but I will defenitely have a look at your suggestion

You speak of showing the objects we want to render, but can we also override at parameter level?

Thanks again
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
You speak of showing the objects we want to render, but can we also override at parameter level?

The whole point is you dont care whats displayed in the viewport. Your using the mantra ROP to control what gets rendered. Whats gets displayed and rendered are two different things at the object level.

You can indeed set parameters on the geometry object node . Render tab > display and the render visibility menu. I never touch them unless its something really specific. Using it as main control would become a fiddle.

If your looking into this due to a need to control geometry visibility in the viewport , ie detailed huge city millions and millions of polys , you can easily build a LOD system starting with a basic box sop to build bounds , and get low res renders , then once happy with animation / effects , render the hires off disk.

From reading some of your other posts it seems like your having to take another departments asset > extract some useful stuff > then do something. Normally when I tackle another departments asset. I take the surgery approach and create a new node or null and extract what I need without ever rebuilding or altering the core asset. Makes“ version” up easy.

Rob
Gone fishing
User Avatar
Member
30 posts
Joined: 1月 2015
Offline
Hi Rob,

In fact I'm not trying to modify visibility nor render visibility. I'm trying to change parameters values depending on if the object is displaying or rendering.

For instance, lets say I have an object with a subdivide. I want the subdivide depth value to be “2” at render time, but “1” at display time.

If I had an expression function or variable to detect if the node is rendering or displaying, that would be super easy.

But I've found the right way to do it I think:
First, I make a subnet for the node I want to set different display and render settings to.
Then, I copy reference the node, and set the render flag to it and the display flag on the original. I then set the values as I want them on each node.

The fact that it is in a subnet enables me to work only on the node that I want. At first I was thinking that I would need to duplicate the whole branch of nodes up to the node I wanted to affect. This would have had a big effect on the graphs visual complexity.

I'm new to Houdini, so this might be common knowledge…
User Avatar
Member
30 posts
Joined: 1月 2015
Offline
Here's a screenshot of what I'm trying to explain
Edited by - 2015年3月30日 17:54:48

Attachments:
2015-03-30 17_53_33-Houdini-Master - panel1.png (97.6 KB)

User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
If I had an expression function or variable to detect if the node is rendering or displaying, that would be super easy.

No need for that ….. set your display flags on nodes

Rob

Attachments:
set_display.hip (56.1 KB)

Gone fishing
User Avatar
Member
4 posts
Joined: 9月 2014
Offline
Drop a switch node
Put this as expression (python) :

hou.isUIAvailable()

Render items will be the first input and display items is the second (obviously render items works on the farm or batch mode, not when rendering with ui. )
User Avatar
Member
30 posts
Joined: 1月 2015
Offline
Hi Rob,

I get your example, and basically your solution is the same as mine
What I was trying to explain is that the subnetworks allow me to set render/display flag per section of graph, thus enabling me to set different render settings per node which is awesome if you want to change settings on a node near the top of the graph without duplicating the whole rest of the graph to have a single render flag at the end. It allows me to set multiple render flags on the same graph if you will. It is in fact acting like the switch node solution proposed by Ferry Taswin.
User Avatar
Member
30 posts
Joined: 1月 2015
Offline
Thanks for your solution Ferry.
I will definitely keep this function in mind
User Avatar
Member
30 posts
Joined: 1月 2015
Offline
I've updated the picture of my solution in one of the previous posts since the render flag and display flags were not set on the good node in the main graph (i.e. on OUT)
  • Quick Links