Tuesday 2 May 2023

Side project: Python UI for texture selection in both Maya and Houdini

I am happy to present a few trials of a side project.

Inspired by Postoffice (Amsterdam) Stadium and Crowd tool, I decided to start development of my own system.

I started with a very basic premise: to be able to select any team, from any football league, from any country and assign that choice to the home and away team. This would then be reflected in the texture of the shirts worn by the crowd.

In this way, I would be able to customise the crowd to any combination. Useful for broadcasters who need to quickly swap teams in virtual stadiums.

This UI was created in Python 2

Team shirt selector from Daniel Sidi on Vimeo.

Team Selector tool in Houdini from Daniel Sidi on Vimeo.

Tuesday 28 March 2023

How to create a pointcloud from any joint of crowd of agents in Houdini


Here is a method I have learned to create a pointcloud from any joint of crowd of agents in Houdini.

For example, an army of soldiers, carrying guns. The FX department require the location and orientation of the end of each gun barrel. We can deliver a pointcloud which has that data.

Here are the steps

First, take your crowd....

// 1. get joint name
string JOINT_NAME = "r_handJA_JNT";
// 2. get joint index
int JOINT_IDX = agentrigfind(0, @ptnum, JOINT_NAME);
// 3. get position of agent
matrix AGENT_XFORM = primintrinsic(0, "packedfulltransform", @ptnum);
// 4. get position of joint within agent
matrix JOINT_XFORM = agentworldtransform(0, @ptnum, JOINT_IDX);
// 5. set offset to end of the gun barrel (enter manually)
vector POS = chv("offset");
// 6. transform by JOINT_XFORM

// 7. trnasform by AGENT_XFORM

// 8. set initial direction along the gun (+x direction)
vector DIR = set(1, 0, 0);

// 9. transform by rotation component of JOINT_XFORM
DIR *= matrix3(JOINT_XFORM);

// 10. trnasform by the rotation component of AGENT_XFORM
DIR *= matrix3(AGENT_XFORM);

// 11. make a new point
int newPoint = addpoint(0, POS);

// 12. set DIR on new point
setpointattrib(0, "DIR", newPoint, DIR);

// 13. delete the agent
removepoint(0, @ptnum, 1);

then export this pointcloud.