Sam Swift-Glasman

Learning Machine Learning

About Me

Expertise
Technical Director
Location
United Kingdom

Connect

My Tutorials

obj-image Intermediate
Islamic Geometry in VEX using Vectors and Matrices

Recent Forum Posts

Environment Artist - FiveAI May 2, 2018, 6:26 a.m.

A unique and exciting opportunity to work in a fascinating new field - Autonomous Vehicles
We are looking for a talented environment artist to join our simulation team.
If you have experience creating photo real environments in Houdini please apply below

https://www.workable.com/j/8F5E437539 [www.workable.com]

duck typing in vex Jan. 4, 2017, 7:42 a.m.

hi all

i am trying to get duck typing behavior in vex where I can scale a space seperated user selection of point attrs regardless of type
this wrangle code is working but it relies on predefined variables and would need extending for matrices and arrays ect
anybody have a nicer solution?
cheers in advance


string attrs[] = split( chs("attrs") );
string pattrs[] = detailintrinsic(geoself(), "pointattributes");
string a;
string pa;
int type = 0;
int typesize;
int tmpi = 0;
float tmpf = 0.0;
vector tmpv = {0,0,0};
foreach(a; attrs)
{
    foreach(pa; pattrs)
    {
        if( pa == a )
            {
                
                type = pointattribtype( geoself(), a );
                typesize = pointattribsize( geoself(), a );
                
                if (type == 0)
                    {
                        tmpi = point( geoself(), a, @ptnum  );
                        setpointattrib( geoself(), a, @ptnum, tmpi * ch("scale"), "set");
                    }
                if (type == 1)
                    {
                        if (typesize == 3)
                        {
                            tmpv = point( geoself(), a, @ptnum  );
                            setpointattrib( geoself(), a, @ptnum, tmpv * ch("scale"), "set");
                        }
                        else 
                        {
                            tmpf = point( geoself(), a, @ptnum  );
                            setpointattrib( geoself(), a, @ptnum, tmpf * ch("scale"), "set");
                        }
                    }
            }
    }
    
    
    
}

String to float for random Sept. 13, 2016, 2:02 p.m.

could be worth checking out the atoi vex function

http://www.sidefx.com/docs/houdini15.0/vex/functions/atoi [sidefx.com]