it is just a cn translation of official document.
you can find the origin at Python scripting [www.sidefx.com]
Houdini's python document is really comprehensive so the translation has 1000+ page.
Found 77 posts.
Search results Show results as topic list.
Houdini Lounge » Python Script Book
-
- zengchen
- 77 posts
- Offline
Technical Discussion » How to I read a key-value dictionary from an expression?
-
- zengchen
- 77 posts
- Offline
JacobAndersen
one (unrelated) question zengchen, is there a deeper meaning why you use a string parameter
houdini expression can only recognise two type - string(chs) and float(ch).
dict parm can not be interpreted as a float type, so it need to be treat as a string parameter, the result is a JSON format string, can be loads(loads is a function) as a dict attribute use vex function.
Edited by zengchen - Nov. 8, 2020 00:00:23
Technical Discussion » How to I read a key-value dictionary from an expression?
-
- zengchen
- 77 posts
- Offline
I have a method to read dict parm but must use Houdini 18.5's dict attribute and json function.
dict attr help [www.sidefx.com]
Now houdini does not have expression to deal with JSON, so you need a wrangle to convert JSON to dict attr…
And then use dict attr to drive another parm.
JSON loads vex function [www.sidefx.com]
dict attr help [www.sidefx.com]
Now houdini does not have expression to deal with JSON, so you need a wrangle to convert JSON to dict attr…
And then use dict attr to drive another parm.
However, there are no JSON-parsing expression functions, and limited string manipulation functions, to deal with such a string in an expression.
JSON loads vex function [www.sidefx.com]
Edited by zengchen - Nov. 7, 2020 06:51:21
Technical Discussion » How to get JSON formatted strings from Ramps
-
- zengchen
- 77 posts
- Offline
Ok, I finally find the “Flatten Ramps” option on “Attribute from Parameters” SOP
it works correctly this time…
I find it can use dict attribute to store ramp /multiparms now in Houdini 18.5, it is really nice.
PS: the “Attribute from Parameters” SOP always grabs the parameter values at the current time. So it seems impossible to get right multiparms if the parms are changing with time.
it works correctly this time…
I find it can use dict attribute to store ramp /
PS: the “Attribute from Parameters” SOP always grabs the parameter values at the current time. So it seems impossible to get right multiparms if the parms are changing with time.
Edited by zengchen - Nov. 1, 2020 11:28:59
Technical Discussion » How to get JSON formatted strings from Ramps
-
- zengchen
- 77 posts
- Offline
Hi all:
I tried the H18.5's new VEX function - ramp_unpack / ramp_lookup yesterday.
But I'm confused with the introduction of the ramp_unpack function.
To my understanding, the ramp_unpack's string parm need a JSON formatted strings from ramp channel.
But how can I get the right json string?
I tried the “Attribute from Parameters” SOP, but the dict(will be converted to JSON use json_dumps function) it gets from ramp channel seems is not the right format which ramp_unpack needs.
I post my hip here.
Does anyone can help me? Thanks.
I tried the H18.5's new VEX function - ramp_unpack / ramp_lookup yesterday.
But I'm confused with the introduction of the ramp_unpack function.
Ramps are commonly packed as JSON formatted strings by Houdini operations.
To my understanding, the ramp_unpack's string parm need a JSON formatted strings from ramp channel.
But how can I get the right json string?
I tried the “Attribute from Parameters” SOP, but the dict(will be converted to JSON use json_dumps function) it gets from ramp channel seems is not the right format which ramp_unpack needs.
I post my hip here.
Does anyone can help me? Thanks.
Edited by zengchen - Nov. 1, 2020 05:51:07
Technical Discussion » Copy to points with random 90 degree rotations
-
- zengchen
- 77 posts
- Offline
oaborazno, copy to points SOP only can recognise these attributes.
On a separate note, is there a way to put an attribute directly into a field in a node?
Copying and instancing point attributes [www.sidefx.com]
only orient or transform attribute can set instance's orientation(rotation).
if you want to use @ratate, you must use it to modify orient / transform attribute
for example, apply to orient, rough code like this:
f@rotate = 45; vector rotDegree = set(f@rotate, 0, 0); int rotOrder = chi("rot_order"); // define a rotate order vector4 rotQua = eulertoquaternion(radians(rotDegree ), rotOrder); p@orient = qmultiply(p@orient, rotQua);
Edited by zengchen - Oct. 9, 2020 12:55:44
Technical Discussion » Copy to points with random 90 degree rotations
-
- zengchen
- 77 posts
- Offline
oaboraz
Is there a way to use euler rotations in the copy to points node?
yes, you can use eulertoquaternion VEX function to create a quaternion from euler rotation, and then use qmultiply VEX function to multiply this quaternion to orient attribute.
rough code like this:
vector rotDegree = {90, 0, 0}; int rotOrder = chi("rot_order"); // define a rotate order vector4 rotQua = eulertoquaternion(radians(rotDegree ), rotOrder); p@orient = qmultiply(p@orient, rotQua);
if you do not want to rotate orient by a quaternion, you also can use maketransform VEX function to create a custom orient / transform directly.
matrix maketransform(int trs, int xyz, vector t, vector r, vector s)
Edited by zengchen - Oct. 9, 2020 02:40:16
Technical Discussion » Copy To Points - rot point attribute not working?
-
- zengchen
- 77 posts
- Offline
you can not use @up before define it.
orient (vector4) / transform (3×3 or 4×4) are the attributes which can directly set instance's rotation, but not rot (vector4).
that means if you have both orient and rot attributes, when use copy to point SOP, the input orient will be rotated by rot inside copy to point SOP first
than copy to point SOP use the modified orient to set instance's rotation.
orient (vector4) / transform (3×3 or 4×4) are the attributes which can directly set instance's rotation, but not rot (vector4).
rot (vector4) is additional rotation (applied after the orientation attributes above)
that means if you have both orient and rot attributes, when use copy to point SOP, the input orient will be rotated by rot inside copy to point SOP first
p@orient = qmultiply(p@orient, p@rot);
than copy to point SOP use the modified orient to set instance's rotation.
Edited by zengchen - Sept. 24, 2020 00:57:01
Houdini Lounge » Isn't it time for some Houdini 18.5 action soon?
-
- zengchen
- 77 posts
- Offline
wanglifu
KineFX sounds interesting…
but i can not get any idea from the name…
does anyone can give me an explanation?

Edited by zengchen - Sept. 23, 2020 06:28:49
Houdini Lounge » Isn't it time for some Houdini 18.5 action soon?
-
- zengchen
- 77 posts
- Offline
matozemberyso houdini 18 should have three versions - 18.0 18.5 18.6?
Actually, looks like it is 18.6.2 already (https://github.com/sideeffects/HoudiniUsdBridge)
Edited by zengchen - Sept. 4, 2020 22:41:34
Houdini Lounge » Had anyone saw the C4D node-based demo?
-
- zengchen
- 77 posts
- Offline
if c4d develop a high-performance expression language like VEX, and make a good document.
I may use c4d instead of houdini…
but for most houdini user, Neutron seems just a node system but have no asset that out of the box to make VFX effect.
I think Maxon will take 3-5 years to complete Neutron…
I may use c4d instead of houdini…
but for most houdini user, Neutron seems just a node system but have no asset that out of the box to make VFX effect.
I think Maxon will take 3-5 years to complete Neutron…
Edited by zengchen - July 25, 2020 00:12:18
Technical Discussion » The best way to split curve at it's points ? [SOLVED]
-
- zengchen
- 77 posts
- Offline
Houdini Learning Materials » add SOP
-
- zengchen
- 77 posts
- Offline
eikonoklastes
I'm on 18.0.499 and I definitely don't have it.
I don't know why

Edited by zengchen - July 7, 2020 07:11:42
Houdini Learning Materials » add SOP
-
- zengchen
- 77 posts
- Offline
eikonoklastesYou need Houdini 18 to get the example from menu.
I don't have this, nor do I recall ever seeing it. What's the secret?
Or you can load example from help page.
They are the same.
Technical Discussion » How to approach the following task to move point on a line
-
- zengchen
- 77 posts
- Offline
Maybe use DOP (Vellum or RBD) or Rigging is better.
I just use vex + solver to approach it.
I just use vex + solver to approach it.
Technical Discussion » How to approach the following task to move point on a line
-
- zengchen
- 77 posts
- Offline
mellowmesher
almost, when you increase the value in current distance its doing what I want, but when you decrease the value it pushes the point in the wrong order. I want that the left point moves until it reaches the next one, then pushes this point until both reach the next one.
I think it may need a solver, to switch increase / decrease situation frame by frame.
I do not know rigging, maybe it will be a better way than vex…
Edited by zengchen - July 2, 2020 08:42:31
Technical Discussion » How to approach the following task to move point on a line
-
- zengchen
- 77 posts
- Offline
Houdini Indie and Apprentice » Curve Boolean like Rhino
-
- zengchen
- 77 posts
- Offline
Edited by zengchen - June 28, 2020 08:40:09
Technical Discussion » How to connect two selected points in direct modeling
-
- zengchen
- 77 posts
- Offline
Alexey Vanzhula
Add SOP
Thank you. I forget Add SOP by group.
I always use add SOP to do other things, but forget some basic operation.
And are there any other way to add multiple lines by one SOP in direct modeling?
I know by pattern in Add SOP can do that, but I think it is inconvenient in direct modeling.
Maybe I would try to use pystate to create one…
Edited by zengchen - June 28, 2020 03:32:15
Technical Discussion » How to connect two selected points in direct modeling
-
- zengchen
- 77 posts
- Offline
-
- Quick Links