Command Line Rendering - how to set an attribute from cmd

   1061   5   0
User Avatar
Member
13 posts
Joined: June 2018
Offline
Is it possible to set an attribute or a channel from the command line?

I have a project where I want to create variations

This is what I would like to do:

hscript proceduralTest.hiplc

#set my_switch attribute to 1

render -V -a Redshift_ROP1

#set my_switch attribute to 4

render -V -a Redshift_ROP1

#...


ps: Tops and wedging could have been good but for different reasons it is not working with my setup
Edited by paulfe - Oct. 2, 2023 17:53:32
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
Hi,

I’ll begin by mentioning that I’ve not been doing command line communication with Houdini.

However, let’s rephrase the case a llittle.

You want a Houdini scene to read some data, right?

And you want to be able to change that data over time?

This can easily be done using a file. It can be a text file.

So with some Python or other language you read this value into your scene.

Then based on the value you use Python to control your node.

Write a list of logical steps then search this and other sorums for specific answers. You can also post a specific questioo as well.

You can automate this by having your scene only read the top line in a text, then delete it. Each time you render aomething different happen.

VEX should also be able to read files.

Actually you can do this all from inside Houdini. Just modify some parm data for example. You can have a sting with: 1 4 2 5

Then for each runtime just reorder the numbers in the parm.

Cheers!
Edited by SWest - Oct. 2, 2023 23:03:41
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
13 posts
Joined: June 2018
Offline
Hi thank you for your reply!
I don't need houdini to read data over time. I need the command line to change a pre-existing parameter in the project and then render. sorry if my question is unclear.
There is an int channel in this project that is controlling variation of the design.
I want to render with a command line in a flexible way so I can do

load hipfile
render variation 1
render variation 44
render variation 55
...
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
Okay, I do a lot of command line professionally and privately. That includes advanced networking between countries and in cities. However, for the case you described I don’t recommend going command line especially not for artists.

The term data in this regard is the same as a parameter value. It is not instructions nor any output.

If you want to learn how to interact with Houdini from a shell window here is the link to the official docs [www.sidefx.com]. Enjoy!
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
13 posts
Joined: June 2018
Offline
SWest
Okay, I do a lot of command line professionally and privately. That includes advanced networking between countries and in cities. However, for the case you described I don’t recommend going command line especially not for artists.

The term data in this regard is the same as a parameter value. It is not instructions nor any output.

If you want to learn how to interact with Houdini from a shell window here is the link to the official docs [www.sidefx.com]. Enjoy!
I could not find much help in the documentation

I found out how to do what I need

hython -c "import hou; hou.hipFile.load('C:/Users/Paul/Desktop/test.hiplc'); node = hou.node('/obj/in'); channel = node.parm('col'); channel.set(1.66); print('Value of col parameter:', channel.eval()); hou.hipFile.save('C:/Users/Paul/Desktop/test/test_modified.hiplc', save_to_recent_files=False)"
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
you got Python commands in there. Cool!
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
  • Quick Links