Tuesday 2 October 2018

emitting only 1 particle per point per frame


Obviously stole this from ODforce:

if you want just 1 particle emitted per point at a given frame, the basic expression would be in the rate of the source node of your pop network
if you decide to put it in the impulse rate :
npoints(opinputpath("../",0))
and turning off the const. activation
if you decide to put it in the const rate
npoints(opinputpath("../",0))*$FPS
and turning off the impulse activation
don't forget to put the emission type to points(ordered) or you won't have a particle per point
this will hower emit the exact amount of points your emitter sop has per frame, so if your emitter has points that last 2 frames, you'll have 2 particles per point after 2 frames.


*Also, you could use $NPT/10 instead of npoints... Dunno if this works

When would you use this?
If you have a source which is changing point count each frame, eg, a pattern of cracks being animated (like when Godzilla is underneath a road)... 

I think the $FPS version helps when it comes to substeps etc like with Maya, where you need to divide the perframe emission to account for the substeps... 

The first option works well if you divide the emission count (just add a /10 or whatever after the expression)

Monday 25 June 2018

Gas field in specified area, alternate...

But wait, there's more!
Another approach I've found on the webs, is to make a Gas Match Field, which makes a new field based on some other value.. eg. Density or Temperature.
You can actually specify a Density that is not the Pyro-sim's density, by using a Source Volume (turns out they don't always have to go into the last input). Point that to your custom volume
Finally, set the control mask to your new field.

All three of these nodes should be plugged into a single merge, which then goes into the Velocity Update of the pyro solver. (or the advect...)

I think this approach might be more flexible, if you are using it to refer to an internal pyro-value like Density or Temp?

Another approach I've seen skips the external source volume and copies the Temperature from the pyro solver itself. They use Gas Match to make a field which is "equal" in size/type to Temperature,
Next they use a gas calculate node to copy the Temperature to the custom field,

Finally, They  use a gas field wrangle to fiddle with the newly created field. Normalise values, or do whatever..

They use the custom field as a mask for dissipate & turb.
Quite a neat way to mess around with the temperature.

Gas field only in specified area. Stolen from the Sidefx site

  1.  In the DOP network, add a SOP Scalar Field node after the Pyro object.
    • Turn on Use SOP Dimensions.
    • Set the SOP path to the path of the fog volume object (for example /obj/mask_object). Make sure Use Object Transform is on.
    • Set the Data Name to something indicating the purpose of this field, for example NoiseMask.
    This attaches the fog volume as field data on the Pyro object with the given name.
  2. Create a Gas Turbulence node and connect it to the fourth ("Advection") input of the Pyro solver.
    • On the Bindings tab, set the Density Field to the name of the mask data, for example NoiseMask. The effect of the node is multiplied by the value of this field.
    • Use the controls on the Turbulence Settings tab to control the amount of turbulence added.


      Important thing to note - by default the control field will not be 100% in control.. You'll see some "leakage" of turbulence. This is because the Control Influence is set to 0.5 by default.. Whack it up to 1, and maybe tweak the remap-graph to fine tune the effect of the turb/whatever.

Saturday 14 April 2018

access 2nd input in a wrangle

point(1, "P", @ptnum);
probably posted something about this before... but the "1" here lets you access the 2nd input's data.

Thursday 12 April 2018

Quick note about Houdini hair

when using Houdini's toolbar hair tools, pay attention to the highest-level node's parameters.
The groom should take place on a static mesh (laydown a timeshift node), and the deform node will do the movement magic.

Thursday 5 April 2018

Exporting curves to Maya

When exporting curves to Maya as arnold ASS files, you can export "pscale" (this can remain a point value) for thickness. Note, it can be varied along the length of the curves, to create variation/tapering etc. A good way to preview the pscale is to add a "polywire" node. You might have to use pscale/2 for the polywire radius. (remember to blast most of your curves first if there are lots and lots of them!)

In the options for the Arnold archive output, make sure the "export Asstoc file" box is ticked. This creates the bounding box info for the curves.


u value tip

With lines, instead of calculating U values by dividing @ptnum by @numpt, you could - at the very start of the process -  add a float attribute (using Attribute Create), with the value set to @ptnum. Lines by default only have 2 points, so pt 0 will have a value of 0 and pt 1 will be set to 1.

You then could resample the lines once they've been copied onto points (eg for hairs), by minimum distance, so that they are divided more evenly. The U value will have been interpolated correctly.