Jump to content

Hi, new here - had a VEX question about DOPs and SOPs


dfo

Recommended Posts

Hey all,

I'm super new to Houdini with a background in game development.  I was going through tutorials on pluralsight and I'm loving it so far.

So I've been expanding on the content and diving into Vex, and I hit a snag trying to run a Solver that changes generated point colours, because I wanted read from and modify persistent data on a separate point outside of the solver network.

I simply created details on the point in an Attribute Wrangle in dataHolders and thought it would be easy to read and write to them from an attribute wrangler infectedPoints in the solver.  

solver-sop_01.PNG.31b6ac29bb98b631f8f181a2a3bc3a8e.PNGimage.png.6470d937c4f385506a6aa55c3c9eec6b.pngimage.png.cc91660a5e69d7087caf5d8ec88c1ae9.png

image.png.8c91acdbfcbdd599fe8d943d76620317.png

The problem is the vex script in the attribute wrangler can't actually read the details ie: 


int pointsVaccinatedSoFar = detail("../../../dataHolders/dataHolderPoint","pointsVaccinated",0);
int maxPointsToBeVaxxed = detail("../../../dataHolders/dataHolderPoint","maxPointsToBeInitiallyVaccinated",0);
printf("points Vaxxed so far: %g\n",pointsVaccinatedSoFar);
printf("points Vaxxed so far: %g\n",maxPointsToBeVaxxed);

The font node pulls the details properly and prints them.  But the printf always yields 0 when maxPointsToBeVaxxed should be 10.

I'm guessing I'm breaking some kind of data context/scope protocol in Vex buuut I don't know enough about Houdini yet to really understand what's going on if that's the case.

Or I guess I'm not using detail() properly, or both ;)

 

Any help would be appreciated!  I'm using Houdini Indie so if you guys can read it I can upload the .hiplc file.

 

Thanks!

Link to comment
Share on other sites

5 hours ago, Jesper Rahlff said:

if you can share a hipfile it would be a little easier to troubleshoot.

 

Hi, sorry I've moved well beyond this setup while I was trying to figure it out.

I think using [addpoint->attribute wrangle] to setup variables in a kind of container is working, I was able to read these across the network with no issue.

The trouble begins when I want to alter those variables, there doesn't actually seem to be a way to write attributes on points belonging to a separate object from an attribute wrangle using vex.

The information I'm looking for is how does one capture attribute data and store it somewhere in the network?

So for example, if I wanted to randomly shift colours on an object's points, then capture those colour at frames 10, 25 and 35, then transfer the color/Cd attribute values to a container object at the obj/ level, and then apply them back somewhere else (wherever) like some shaders later on, what's the high level setup/thinking to make this happen?

 

Sorry again if this is confusing, being new to houdini I don't always know how to word problems and solutions properly!

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...