Anyone know of a good technique to take some pre-modelled geometry and progressively Cookie (Union) all the connected meshes together inside? I.e, from some random geometry end up with a non-intersecting union of all the closed poly meshes?
Thanks!
Jason
Cookie on connected groups, recursive
5564 3 0-
- jason_iversen
- Member
- 12986 posts
- Joined: July 2005
- Offline
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
-
- wolfwood
- Member
- 4325 posts
- Joined: July 2005
- Offline
Hmmm,
If you have lots of different SOPs you can do something like
set counter = 0
foreach obj (`execute(“opls”)`)
if ($counter == 1) then
set newCookie = `execute(“opadd -v cookie”)`
opwire $obj -0 $newCookie
opwire $lastObj -1 $newCookie
set lastCookie = $newCookie
else if ($counter > 1) then
set newCookie = `execute(“opadd -v cookie”)`
opwire $obj -0 $newCookie
opwire $lastCookie -1 $newCookie
set lastCookie = $newCookie
endif
set lastObj = $obj
set counter = `$counter + 1`
echo $obj
end
You could use “opgls” instead of “opls” if need be.
If your geometry is all in one SOP and you want to loop through all the different groups inside that SOP then I'll…ummm…get back to you on that. :?
jim.
If you have lots of different SOPs you can do something like
set counter = 0
foreach obj (`execute(“opls”)`)
if ($counter == 1) then
set newCookie = `execute(“opadd -v cookie”)`
opwire $obj -0 $newCookie
opwire $lastObj -1 $newCookie
set lastCookie = $newCookie
else if ($counter > 1) then
set newCookie = `execute(“opadd -v cookie”)`
opwire $obj -0 $newCookie
opwire $lastCookie -1 $newCookie
set lastCookie = $newCookie
endif
set lastObj = $obj
set counter = `$counter + 1`
echo $obj
end
You could use “opgls” instead of “opls” if need be.
If your geometry is all in one SOP and you want to loop through all the different groups inside that SOP then I'll…ummm…get back to you on that. :?
jim.
if(coffees<2,round(float),float)
-
- jason_iversen
- Member
- 12986 posts
- Joined: July 2005
- Offline
Thanks for the idea for that one, but unfortunately it's all in one SOP. I get the idea this might be a job the the HDK!
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
-
- wolfwood
- Member
- 4325 posts
- Joined: July 2005
- Offline
Are each of the groups a closed object? Like take 5 different spheres, put each one in its own group then merge them all together with a Merge SOP. Is this “Merge SOP” something like what you have?
Are your group names “script friendly”? Like myGroup1, myGroup2, myGroup3…..?
jim.
Are your group names “script friendly”? Like myGroup1, myGroup2, myGroup3…..?
jim.
if(coffees<2,round(float),float)
-
- Quick Links