Monday, 22 September 2025

make grid into sphere

 

MAKE THESE NODES PLUG THEM IN BLAM
just in case the image is dead, assuming a grid lying on XZ plane
A loose relbbox with "input" set to "First Input", plugs into a vecToFloat.
The X and Z outputs plug into the U and V of a fromPolar.
Output of fromPolar goes into a Multiply. A loose makeXForm goes into 2nd input of the multiply.

Output of Multiply goes into the GeoVopOutput P input.

I think this post explains a bit more about how this works, but the rough dummy explanation is that you're making "sort of UV coordinates based on the position of your grid" (hence the relbbox), then you move your points to the uv of the target object.

https://www.sidefx.com/forum/topic/60740/?page=1#post-272057


 

How to move point/points along a curve

Some wise words from Toadstorm on the odforce forum. 

Make your main curve, blast some points off that you want to move along this main curve..
The main curve goes into input "one" (2nd input) of both wrangles. The points wrap round too, which is cool.
Good for a stream of things moving along a curve constantly. Things to consider, different u-increment values per points.

If you want to do it manually, what you probably want to do is create a duplicate set of disconnected points via the Add SOP or whatever, and then use xyzdist() to determine their relative positions along the parametric U of the curve. This would be done in a point wrangle, with your disconnected points in input 0 and the original curve in input 1:

int posprim;
vector primuv;
float dist = xyzdist(1, @P, posprim, primuv);
f@u = primuv.x;

Then after that's been established, you can use a second wrangle with a parameter to add to that starting @u value and lock each point to the position along the curve that matches the new parametric U value:
 

float add_u = ch("add_u");
float new_u = (f@u + add_u) % 1.0; // wrap points if they go past 1.0
vector new_P = primuv(1, "P", 0, new_u);
@P = new_P;


a quick addition - it's probably worth making a new_N and getting the Normal from the curve too!
vector new_N=primuv(1,"N",0, new_u);
@P=new_N;

Monday, 9 June 2025

"details" to get string attribute into uvquickshade

say i have a primitive attrib with a texture path in it... But i want a uvquickshade to use this string value..
the easiest way I've found to get to it, is promoting it first to a detail attribute, then in the uvquickshade param box put this in -

 `details("../attribpromote1/", "texturePath")`

where attribpromote1 is the node before the uvquickshade... and texturePath is the string attribute name.

Friday, 9 May 2025

splitting strings

I think I did a post on this quite a while ago, though it seemed inconclusive and unsure... This seems to work at the moment.

user gnisbet posted this example on the Sidefx forum:

nicely demo's the vex split function.
 
s@my_string = "/mainfolder/assetFolder/ProjectName_vegetation_big_Tree_eucalyptus_a.abc";

// Grab the value after the last split
s@last_split = split(s@my_string, "/")[-1];

// Grab the last 48 digits
s@last_48 = s@my_string[-48:];

// Define attributes, and then use those in the function to grab those values
string dir, name;
splitpath(s@my_string, dir, name);

// Set the attributes on the points from the values
// You could also define these in the function directly if you'd like
s@dir = dir;
s@name = name;

I can't seem to get it to work if you do:
string test_string=s@my_string;
it seems to require both variables to be "@"'s like
s@test_string=s@my_string;

Monday, 5 May 2025

remove or hide camera from dropdown menus

 

sometimes you have too many utility or test cameras and you want to remove them from your dropdown menus... To do this, add the "soho_renderview_menu" property to your camera's parameters and uncheck the box. Tip taken from Tomas/anim of Odforce