Image Not Found
Found 337 posts.
Search results Show results as topic list.
Technical Discussion » Grouping and active state on RBD sim
- AndyW
- 337 posts
- Offline
For what it's worth here's the fixed .hip file, Thanks Midassilver for the tips. Since I'm setting my active value with bounded grouping I didn't need to use the solver sop to accumulate color
Technical Discussion » Grouping and active state on RBD sim
- AndyW
- 337 posts
- Offline
Super helpful, thanks! I'm not clear on why the for-loop is needed, promoting the point color attribute to detail and back again. Thanks again
Technical Discussion » Grouping and active state on RBD sim
- AndyW
- 337 posts
- Offline
Ok, I know this has to be a pretty simple thing but I'm finding myself a little stumped. In the hip file attached I've got a simple test sim with packed RBD and constraint network. I'm grouping points and making them active to create a very specific shape in how it breaks apart initially.
So far so good, but at some stage in the sim I'd like to add other groups to the active state to have it fall apart in stages. I know this is a task for a sop solver, but everything I've tried on this so far doesn't yield anything. Much appreciate any advice and help on this!
So far so good, but at some stage in the sim I'd like to add other groups to the active state to have it fall apart in stages. I know this is a task for a sop solver, but everything I've tried on this so far doesn't yield anything. Much appreciate any advice and help on this!
Edited by AndyW - 2019年4月5日 15:13:01
Technical Discussion » Material Stylesheets - random texture for assigned shader
- AndyW
- 337 posts
- Offline
One way to do this without material stylesheets is by setting paths to your textures as string attributes on your instance points and calling them at render time using a renderstate input to your shaders.
In VEX to randomize shirt textures numbered 1-5, on your instance points:
int randshirts = rint(fit01(rand(@ptnum),1,5));
s@shirtpath = sprintf(“$JOB/Houdini/tex/male_clothes/tshirt_%d.jpg”, randshirts);
Number your shirt variations sequentially (tshirt_1.jpg, tshirt_2.jpg, etc),set your renderstate to string and call shirtpath, wire that into the texture input you're using in your shader, voila randomized textures.
You can do something similar to vary skin tones and hair with ramps, set color attributes with ramps on your points and call them with renderstate. In this case use grayscale texures and wire the color renderstate into the base color, you can retain your skin and hair textures but modify their color per instance randomized along your color ramp.
In VEX to randomize shirt textures numbered 1-5, on your instance points:
int randshirts = rint(fit01(rand(@ptnum),1,5));
s@shirtpath = sprintf(“$JOB/Houdini/tex/male_clothes/tshirt_%d.jpg”, randshirts);
Number your shirt variations sequentially (tshirt_1.jpg, tshirt_2.jpg, etc),set your renderstate to string and call shirtpath, wire that into the texture input you're using in your shader, voila randomized textures.
You can do something similar to vary skin tones and hair with ramps, set color attributes with ramps on your points and call them with renderstate. In this case use grayscale texures and wire the color renderstate into the base color, you can retain your skin and hair textures but modify their color per instance randomized along your color ramp.
Technical Discussion » setting @orient with degrees
- AndyW
- 337 posts
- Offline
In case this is useful for anyone else, these vex expressions allow me to rotate @orient by degrees, but also set a randomized min and max value for those rotations base on the point number. Min and max sliders should go from -1 to 1 and the rot slider 0-360
float randx = fit01(rand(@ptnum),ch('min_x'),ch('max_x'));
float randy = fit01(rand(@ptnum),ch('min_y'),ch('max_y'));
float randz = fit01(rand(@ptnum),ch('min_z'),ch('max_z'));
float rotx = ch('rot_x')*randx;
float roty = ch('rot_y')*randy;
float rotz = ch('rot_z')*randz;
vector r = set(rotx,roty,rotz);
p@orient = eulertoquaternion(radians(r),XFORM_XYZ);
float randx = fit01(rand(@ptnum),ch('min_x'),ch('max_x'));
float randy = fit01(rand(@ptnum),ch('min_y'),ch('max_y'));
float randz = fit01(rand(@ptnum),ch('min_z'),ch('max_z'));
float rotx = ch('rot_x')*randx;
float roty = ch('rot_y')*randy;
float rotz = ch('rot_z')*randz;
vector r = set(rotx,roty,rotz);
p@orient = eulertoquaternion(radians(r),XFORM_XYZ);
Technical Discussion » setting @orient with degrees
- AndyW
- 337 posts
- Offline
Technical Discussion » setting @orient with degrees
- AndyW
- 337 posts
- Offline
I'm wondering what the best way to go about using degrees to set @orient, here's what I have:
vector4 x_rot = quaternion({1,0,0}*ch('x_rot'));
vector4 y_rot = quaternion({0,1,0}*ch('y_rot'));
vector4 z_rot = quaternion({0,0,1}*ch('z_rot'));
@orient = qmultiply(@orient, x_rot);
@orient = qmultiply(@orient, y_rot);
@orient = qmultiply(@orient, z_rot);
Which works fine, but setting quaternion values with sliders isn't very intuitive
vector4 x_rot = quaternion({1,0,0}*ch('x_rot'));
vector4 y_rot = quaternion({0,1,0}*ch('y_rot'));
vector4 z_rot = quaternion({0,0,1}*ch('z_rot'));
@orient = qmultiply(@orient, x_rot);
@orient = qmultiply(@orient, y_rot);
@orient = qmultiply(@orient, z_rot);
Which works fine, but setting quaternion values with sliders isn't very intuitive
Technical Discussion » Instancefile-groups
- AndyW
- 337 posts
- Offline
With instancefile the geometry is just a point attribute until render so you would need to unpack the geometry in order to access point or primitive groups, which defeats the purpose of instancing in the first place. So the question is about your specific purpose for accessing groups when instancing, the workflow may be different when working with packed geometry
Technical Discussion » Getting alembic frame range as an attribute
- AndyW
- 337 posts
- Offline
I'd like to grab start and end frames from the alembic SOP as attributes, I can see it in the node info but I'm not sure how to access those values directly, any tips? Thanks!
Technical Discussion » Speeding up IFD gen with material exports
- AndyW
- 337 posts
- Offline
Generating IFD with material exports for for rendering instances is a bit of a pain point, I wondering if anyone has tips for streamlining and speeding that up?
Technical Discussion » HDA defaults
- AndyW
- 337 posts
- Offline
Technical Discussion » HDA defaults
- AndyW
- 337 posts
- Offline
It seems whatever values I have when I first create an HDA stick, I'm trying to find a way to change default values on an HDA once it's created, what I'm I missing? Thanks!
Technical Discussion » weighted random number generation
- AndyW
- 337 posts
- Offline
Technical Discussion » weighted random number generation
- AndyW
- 337 posts
- Offline
Something I've come across frequently and I'm curious how people are going about this. In a scenario where I'm grouping points based on a random number seeded by @ptnum, let's say into 4 equal amounts. How would I go about weighting those groupings? For example, adding more points to group 2 than the other groups? I hope that makes sense, shout at me if it doesn't
Technical Discussion » instance sequence stutter
- AndyW
- 337 posts
- Offline
Thanks! rint() seems to fix the issues. I'm not familiar with age stratification, I assumed you meant life variance or jitter birth time, both of which were turned off in my set up
Technical Discussion » instance sequence stutter
- AndyW
- 337 posts
- Offline
I did try floor() and ceil() initially, no success. For instance, an age float value of 0.291667 gives int frame 7, but so does the next age value, 0.333333
Technical Discussion » instance sequence stutter
- AndyW
- 337 posts
- Offline
So I'm getting random duplicate frames when I instance cached animation, seems to be due to the way I'm driving the frame number of the cached files with @age, rounding errors when it converts to integer? I'm doing int frame_num = (@age * 24) when I build my instancepath string, how should I be going about this? Thanks!
Technical Discussion » instance animation stuttering
- AndyW
- 337 posts
- Offline
I've been running into issues lately with instances stuttering, like they're holding a frame here and there. I don't see anything in the cache files that would indicate a problem, it seems to be occurring when the files sequences are instanced. Any clues?
Technical Discussion » Importing alembic files the right way
- AndyW
- 337 posts
- Offline
Use the Alembic file importer inside a geometry context instead of the import alembic scene menu command. You can filter the geometry you want to use with wildcards in the Object Pattern field, or just select the object path manually. You'll need to add an Unpack sop after the importer, and it's usually a good idea to convert to poly as well.
Technical Discussion » Change POP lifespan downstream from popnet
- AndyW
- 337 posts
- Offline
D'oh! yeah that makes sense. I'm doing a longer lifespan and adjusting that shorter downstream which works fine
-
- Quick Links