Wednesday 14 September 2022

filename using digits of the node

 use case - you have many texture nodes, eg. Texture1, Texture2,Texture3.....

You want to automate the filename being loaded & use the number contained within the node name.

To do this we can use a combo of expressions -

//server/jobs/build/ion/textures/flooring/tile_`padzero(2,opdigits("$OS"))`.jpg

where the texture node is Texture5 becomes

//server/jobs/build/ion/textures/flooring/tile_05.jpg

So if we copy and paste this many times, it will update to tile_06, tile_99 etc...


padzero(2, SOMETHING) - pads the value SOMETHING with up to TWO zeroes. 5 becomes 05, 99 stays as 99.

opdigits("whatever") - returns the numbers of "whatever". In the example above, I use the $OS expression to get the name of the node itself-  ie; Texture5, so we get back 5. The padzero makes it 05.

these bits are enclosed with backticks  ` `, to execute the expressions.

Tuesday 22 March 2022

un pinning vellum constraints

in a pop wrangle, inside the vellum solver, do something like this


 if(@Frame>1175){i@stopped=0;}

as far as i know it works on Pin constraints, set to "stopped".


this vid from Sidefx explains it towards the end, sort of.

https://youtu.be/t_lyBo1U1t8

Tuesday 22 February 2022

Getting Point Attributes in CHOPS

Scenario - Had some points that were moving in unison, I wanted to stretch/squash each point's animation individually so they'd move at different rates. 
I made a point attribute for each called "shift" and gave them a random value between a min and max.

Then I made a CHOPNET and imported the geometry with the tx,ty,tz and shift channels.
Next we need a foreach chop node, be sure to specify all the channels in the parameter box.


Now dive into the foreach node and make a Stretch node.

I just wanted to use the shift attribute in the main Length Scale parameter, so I use the "chopi" function which seemed the simplest out of all the chop_ functions available. It evaluates the channel specified in quotes at the index you give it. This index is meant to be along the timeline, I believe - but since our value is a constant you can throw in any number.

chopi("../Foreach_Iteration/shift",10)

The Stretch node goes to the built in output node...make sure that one is being exported.

This should work now...each point's transform animation stretched according to the shift attribute.

Another thing I found whilst trying to figure this out was the Reorder node. It lets you sort the channels according to different rules. So if you use the number suffix, then it will "group" all the same point channels together. shift0, tx0,ty0,tz0, shift1,tx1,ty1,tz1....etc.... Could be useful if you have some sort of nth based logic going in a script or something, although I really think this for each method works much better.

I'm sure there are better ways to get point attributes in CHOPS.....I just can't figure them out haha. Let me know in the comments, if I've remembered to enable them.

Friday 26 November 2021

baking textures with Redshift

This youtuber explains how to bake lightmaps... Textures is a very similar process
 https://www.youtube.com/watch?v=N5LcTTywUVs

The key points.. I will do a proper write up later.
Tick "bake rendermaps" in your Redshift Rop.
Ensure the object you're baking is specified in both the Rendermap & Objects tabs
The baker will just bake whatever it is given - so for noise/triplanars, you might want to make a new material with just that node pulled in, using a material merge. Or you might want to pull in the whole diffuse colour etc.
For bumps/float values, I use a "Color maker" node as an "out" null.. Nulls don't seem to behave. (could be wrong on this)


oh - and make sure in the IPR tab of the rop, IPR Progressive Rendering is turned OFF.

oh oh - remember to put the objects and/or lights you might want to be baking into the usual objects bit of the ROP!

Wednesday 3 November 2021

switch node or blending transforms at object level

If you need to switch or blend between two (or more) null transforms, eg to parent an object use the BLEND OBJECT. Kinda simple, goes to show how much I work at SOP level ha.

You'll probably want to use the Sequence mode, with "Shortest Path Rotation Blending" ticked, to avoid weird flipping (depending on what and how you're blending stuff)

Thursday 1 April 2021

attaching nulls to parts of a moving/deforming object. rivet.

At SOP level, select 3 points of the geo you need to attach a rivet to, this is to calculate rotation (if your object/mesh-area is rotating/deforming)

Make a group with these points, call it something like "pivot_group".

 Go up to Object Level and make a Rivet node.
Here, specify the SOP eg - /obj/geo1/object_merge1

and the pivot_group in the Point Group dialog box.


You can now parent a NULL or something else to the rivet. Something I noticed, was the rotation of the null can be a bit offset, and I've been manually adjusting the rotation...

If you're exporting a null for Flame, you might be better off parenting a camera object, as the alembic export seems to ignore the null. Maya will import a null, although it will show up as an invisible point, so again you're probably better off using a camera for this too.

I've been exporting the null using the File-Export-Alembic tool..