jan.b

jan.b

About Me

Connect

LOCATION
Not Specified
ウェブサイト

Houdini Engine

Availability

Not Specified

Recent Forum Posts

Python states and StrokeState anchor new curves on existing 2024年2月22日8:35

Well so there's a ugly answer to that question but i'm sure there's a better way.

Make a feedback loop to the draw curve itself (in a one iteration loop) and move the curves on the plane they originated from :

 // Find the prim the current point belongs to, then store the point ID
// of the first point in that prim
int point_prim = pointprims(0, @ptnum)[0];
int first_point_id = primpoints(0, point_prim)[0];
// Use projection attributes stored on the stroke primitive
// to move points
vector p0_orig = point(0, "stroke_orig", first_point_id);
vector p0_proj = point(0, "P", first_point_id);
float dist_to_p0 = length(p0_orig - p0_proj);
v@P = v@stroke_orig + ( normalize(v@stroke_dir) * dist_to_p0 ); 

Python states and StrokeState anchor new curves on existing 2024年2月22日6:35

Hello
I want to build an hda that uses the stroke node.
Strokes would be drawn in screen space. When a new stroke is about to be made the hda will be able to intersect with a previous curve and set the projection center to that point.

I copied that snippet that work with the class State(object) I believe.
geometry = self.node.geometry(0)

        origin, direction = ui_event.ray()
        
        position = hou.Vector3()
        normal = hou.Vector3()
        uvw = hou.Vector3()
        
        intersected = geometry.intersect(origin,direction,position,normal,uvw)
        self.node.parmTuple(f"stroke_projcenter").set(position)

It is able to get the pos in space for the intersect.
Unfortunately that put in class(StrokeState) doesn't do anything.

Is there a way to achieve that for strokestate on prestroke for example ?

Thank you so much in advance.

sequence of stills seen as a sequence in cop 2018年3月7日20:25

Hello forum

I'm loading automatically a set of images in cop and these images have a the same number in their filename,
Something like xxx_T200_basecolor.png T200 stands for tile 2meters.
On each frame there's a different image but all of them have T200 inside their filename.
Because of this they're seen as a sequence and xxx_T200_basecolor.png is interpreted as frame 200
So is there a separator that would make things more clear for houdini?
Tried the override but it's still a sequence.
Any clue on how to resolve this would be appreciated since i'm stuck for two days on this problem.
Thank you.