jason_iversen
June 16, 2003 19:15:40
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
wolfwood
June 16, 2003 20:47:39
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.
jason_iversen
June 16, 2003 21:35:39
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!
wolfwood
June 16, 2003 23:03:42
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.