Jump to content

Extrude SOP - how to move objects with extruded faces by f@zscale


Eyteneyer

Recommended Posts

Hello Forum ,  i have a question. In project i need to put object on extruded face to move them together.

I've done this with just main "dist parameter(float)" myself just add simple expression to "transform Sop" in translate Y

It's work with little expression :
 bbox("../polyextrude ", -D_YMAX)-$YMAX+0.5   --- or ---  ch("../polyextrude4/dist")


But i go next level with this method and face to Wall of problem..  I try to extrude faces with distance scale "zscale"  i've create attrib with "attrib wrangle" and simple expression "f@zscale = fit01(rand(@ptnum), chf('min'), chf('max'));"

This works well, this expression move extruded faces randomly by Distance scale -  ptnum, but i need to put object on extruded face to move them together.  I try cople of methods but they didnt works.

Please Help.

Extrude_sop_zscale_dist_scale.mov

Link to comment
Share on other sites

6 hours ago, Eyteneyer said:

I just wont all figures permanently stay on they scuare and control this behaviour with  "extrude sop" "distant scale".

Hello,

maybe is it worth to go the other way? I would made points at the center of each top primitive of the checkerboard after extrusion, and used copy to point sop. This way all figures will be always on top.

  • Like 1
Link to comment
Share on other sites

Hi Ilya, the instance geometry node offers a more usable approach : https://www.sidefx.com/docs/houdini/nodes/sop/instance.html

  • Assign an arbitrary number of objects in a multiparm block.
  • Then apply random choices to s@instancepath for random distribution.
int seed = chi('seed');

int inst_total = chi('instances');
int inst_num = int(rand(@ptnum + seed) * inst_total) + 1;

s@instancepath = 'op:' + chs('object_instance' + itoa(inst_num));
f@pscale = chf('scale' + itoa(inst_num));

image.png.2b3bb360226cf4a85e855b3f043cb516.png

chess_instancing.hipnc

You can read more about instancing here: https://www.toadstorm.com/blog/?p=493

Edited by konstantin magnus
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...