Jump to content

New user - workflow suggestion


blinker

Recommended Posts

Hi 

I consider myself a new user of Houdini. Other than using it sporadically a few years ago . Been a Maya power user the last 12 years so I've been set in my ways I guess

 

Anyways , I'm embarking on learning Houdini afresh for procedural modelling, and I'd like a few pointers and suggestions on what I should focus on 

 

Sorry for long post 

initially I'd like to get to grips with managing 'loop iterations' and creating multiple variations of assets which can be scattered or accessed using IDs. I'd normally write a python Maya UI and offer the user a 'step by step, now click this' type of approach which is .....because Maya 

I guess a simple exercise would be a field of cabbages :

 

Import an alembic containing several  leaves

Duplicate n number of randomly selected leaves around a pivot 

repeat to make layers 

warp them to make them look a bit organic 

--do this n number of times and store results in a cabbage array --

take a random cabbage 

place it somewhere on a plane 

assign a random range rotate / scale 

--etc etc--

 

So from the above example I can see that I'd need some basic functions such as 

- gathering n number of leaf asset(s) IDs from an imported file

-or splitting an imported geometry into different assets ( primitives ) 

- selecting n number of them 

- set their pivot to their minY

- radial rotating them around a pivot 

- declaring the result as a new cabbage asset ID 

- have n number of these 

- scatter them across a plane 

- avoid intersections 

 

Without python it's pretty crazy to do this in Maya, with python it's easy . So what sort of nodes and workflow should I adopt in Houdini ? Can I avoid scripting ? 

Im guessing nodes like copyToPoints, group, transform are ones to use, but what about for loops and if ? Can I represent those sorts of queries in a node based manner ? 

 

 

 

 

Link to comment
Share on other sites

On 6/12/2017 at 5:47 PM, blinker said:

initially I'd like to get to grips with managing 'loop iterations' and creating multiple variations of assets which can be scattered or accessed using IDs. I'd normally write a python Maya UI and offer the user a 'step by step, now click this' type of approach which is .....because Maya 

 

Yep, you can work this way in Houdini if you want, but you tend to miss a lot of the realtime power Houdini provides. If you've been doing this for a while, a better analogy is Nuke; setup some read nodes, runs through some compy nodes, a write node at the bottom receives your magical sexy frames. Change the read node at the top, get a quickly update write node at the bottom.

On 6/12/2017 at 5:47 PM, blinker said:

Import an alembic containing several  leaves

Duplicate n number of randomly selected leaves around a pivot 

repeat to make layers 

warp them to make them look a bit organic 

--do this n number of times and store results in a cabbage array --

take a random cabbage 

place it somewhere on a plane 

assign a random range rotate / scale 

Generally speaking, yes, this can all be done in a node workflow. You might be able to do it without code, but a little bit here and there will save a lot of time in the long run. Think of this sort of houdini coding more like maya expressions rather than scripting, except much faster and more powerful.

If I get time I'll try and knock up an example tomorrow, but here's a stream-of-consciousness babble of taking what you've described and converting it into a houdini speak. When I start talking about points and point attributes, the closest maya analogy is maya particle attributes, to eventually drive a particle instancer. A sop is a surface operator, ie, a node.

  • Import alembic of leaves, treat each leaf as a single entity (called a packed primitive in houdini)
  • move all leaves to the origin (transform sop), align along z (another transform sop), set bottom of leaf to ground (yet another transform sop), set aside for now
  • create a line (line sop)
  • twist it into a spiral (vex or vop network, or the bend sop) to get that fibonacci style layout of the curve points
  • ensure the curve points have a N attribute to determine direction, and a scale attribute for scale. Ideally drive both of these with sliders or a ramp widget so they can be adjusted 'live', I'd do this in vex code (a wrangle sop), or with vop nodes ( a point vop network)
  • setup a node based for loop, set to iterate over each point on the curve. inside:
    • select a single leaf randomly, use a copyToPoints sop to copy that leaf onto a point. The N and scale attributes will determine the rotation and scale of the leaf
  • create a grid to determine the final cabbage placements in the scene (grid sop)
  • scatter sop to distrubute points over that plane. in its default mode it will try and 'relax' the points so they don't intersect
  • again, add N and scale attribute to drive each cabbage rotation and scale
  • copyToPoints to copy a cabbage to each location
  • If you need more variation, you could swap the node network around a little, so you first copy the curves to the cabbage locations, then copy the leaves to all the curve points, so each point gets a random leaf

That's the vague idea anyway. Houdini has always had node based loops (a foreach sop), but was a little unwieldy. H15 introduced new for loops that are unwieldy in a different way, but they work, and scale much better when you do lots of looping. An if statement at the sop level can be done with a switch sop, or with a split sop depending on what you're trying to do. You can also do lower-level if/loops in vex and vops, which is more akin to doing processing at the points/verts/polys level. 

Hope that helps, but reading it back I know a hip file would explain it even better. Unfortunately its 12:45am here, so it'll have to wait... ;)

 

-matt

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...