python how to drop a for loop block

   2702   2   0
User Avatar
Member
624 posts
Joined: Aug. 2008
Offline
i am wondering now that we do for loops in houdini and drops 2 nodes, how can i do that with python, do they have a particular name?

thanks guys.
User Avatar
Member
2658 posts
Joined: June 2008
Offline
If you don't know something you can drag and drop it into the Python Shell and obtain it's path. From there you can also assign that path to a variable then use standard Python print dir(my_var) to determine properties and methods.

Don't look for the name, look for the type.
Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
User Avatar
Staff
6789 posts
Joined: July 2005
Offline
This is the code for the For loop, for example.

import soptoolutils
import toolutils
(begin, end) = soptoolutils.buildBlockPair(kwargs, 'repeat', 'block_begin', 'block_end', False)
end.parm('itermethod').set('count')
  • Quick Links