Vex & Multithreading.

   2049   3   0
User Avatar
Member
8 posts
Joined: July 2018
Offline
Hi,
First post here since I start learning Houdini 3 weeks ago.
I'm trying to build vex code in an attribute wrangler node and I face some issues that perhaps you could help.

Input of my vex code is an object with primitive, wrangler node set to primitive.
I'm trying to randomly set an attribute (lets say i@electedPrimitive) to 0 or 1 with one constraint.
Constraint is 2 “connected” primitive couldn't be set to 1.

I have a function that return the “connected” primitive list of a specific primitive

So basically I have a var randomly set to 0 or 1
If 1, I get all “connected” primitive and count their electedPrimitive attribute.
If different from 0 then at least one of my “connected” primitive has been elected so I change the var to 0
In every situation, I store the var value in the electedPrimitive attribute.

Since this easy task did not work I'm wondering if I could change the electedPrimitive attribute on primitive 10 and read the attribute from primitive 10 on primitive 20 (10 & 20 are just example of course)

My guess is that primitive value are some kind of lock until the end of node.
Perhaps this is due to multitasking ?

Any advise ? solution ?
regards
FRED
User Avatar
Member
7737 posts
Joined: Sept. 2011
Online
sounds like you are trying implement a graph coloring algorithm. I'm not familiar with the proper solution, but perhaps this can get you started on finding one:

https://en.wikipedia.org/wiki/Graph_coloring [en.wikipedia.org]
User Avatar
Member
12428 posts
Joined: July 2005
Offline
John, you should change your icon to a paperclip
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
7737 posts
Joined: Sept. 2011
Online
no u
  • Quick Links