Python Execute Node

Post here anything related to RealFlow that doesn't specifically belong in any of the forums below
Post Reply
Shawn Kearney
Posts: 4
Joined: Thu Dec 07, 2017 6:19 pm

Python Execute Node

Post by Shawn Kearney » Thu Dec 21, 2017 8:38 pm

Can anyone provide an example of the Python Execute Node, or at least a primer on how to use it? I am confused by "does not return a value". I am assuming that this means you cannot manipulate inline, like houdini's wrangles?

Thomas Schlick
Posts: 178
Joined: Tue Aug 29, 2017 12:35 pm

Re: Python Execute Node

Post by Thomas Schlick » Fri Dec 22, 2017 1:21 pm

I assume it's about executing a RF command via a Python script?

Every RF command has an Id and you can see it when you right-click on a shelf icon, and choose "Edit Command", e.g. Class ID = 110203 for the gravity daemon. Once you know the Id you can call the command with

Code: Select all

scene.executeCommand(110203)
I hope that helps and is what you're looking for.

Shawn Kearney
Posts: 4
Joined: Thu Dec 07, 2017 6:19 pm

Re: Python Execute Node

Post by Shawn Kearney » Fri Dec 22, 2017 7:09 pm

hmm. ok.

What I'd really like to do is to generate noise and apply it to a field using python's noise module.

From the Variable Viscosity graph, I gather that the way this is to write the value into a particle, and then push that value into the field that the solver uses to evaluates the particle's velocity. As I understand it solver field data such as viscosity is transported in space via particle attributes?

So then with that, to get, for example, a fluid with mixed-in with lumpy goo I would need to use python to to write an attribute calculated from noise() and then pass that on to the viscosity field with graphs?

Unless is there any way to do this entirely in graphs? That is what I was hoping Python Execute could do. Are there any graph nodes for noise?

Thomas Schlick
Posts: 178
Joined: Tue Aug 29, 2017 12:35 pm

Re: Python Execute Node

Post by Thomas Schlick » Sat Dec 23, 2017 1:29 pm

Ah, this clarifies a lot of things. I thought it's related to your last post with the export resources. Unfortunately, there's no direct connection between Python and graphs. What you can do is to create a custom channel for your Python data, read out this channel with a graph, and pipe it through a custom field to the viscosity graphs node.

If I recall correctly the space variable viscosity example graph uses a custom channel and you can use it as a template. In Python you have apporpriate functions as well.

Shawn Kearney
Posts: 4
Joined: Thu Dec 07, 2017 6:19 pm

Re: Python Execute Node

Post by Shawn Kearney » Wed Dec 27, 2017 9:36 pm

Oh! Sure, yeah, sorry about that. I'm actually about to start that script pretty shortly, so you'll probably hear from me regarding that soon!

Post Reply