Python Execute Node
-
- Posts: 4
- Joined: Thu Dec 07, 2017 6:19 pm
Python Execute Node
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?
-
- Posts: 178
- Joined: Tue Aug 29, 2017 12:35 pm
Re: Python Execute Node
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
I hope that helps and is what you're looking for.
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)
-
- Posts: 4
- Joined: Thu Dec 07, 2017 6:19 pm
Re: Python Execute Node
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?
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?
-
- Posts: 178
- Joined: Tue Aug 29, 2017 12:35 pm
Re: Python Execute Node
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.
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.
-
- Posts: 4
- Joined: Thu Dec 07, 2017 6:19 pm
Re: Python Execute Node
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!