DOP question

   22878   22   0
User Avatar
Member
509 posts
Joined: July 2005
Offline
Hi there,

I'm running a DOP simulation. I need to run the whole thing in 3 simulations because of camera movement and end simulation results which are constrained to shot directions.
What I'm trying to do is to make some RBD object, coming from a RBD fractured object (let's say a bunch of copied balls over scattered points) disappear when they hit a wall.

The way I'm following is using a scriptSolverDOP, I'm checking collision data with scripts and setting my custom DOP data.. then I'm stuck.

The final result would be having some DOP data which I'd love to become SOP attributes, or anything that allows me in SOP to delete such RBD spheres using deleteSOP and expression that check attributes, or groups.

Starting by the point that I'm not that savy with DOP data the questions are:

- is possibile to create an attribute (like in POP) from DOP data? if so … how?
- I'm using Hscript to create my custom data set with scriptsolverDOP … but I'm having problem with it … basically I'm checking if the objid is greater than 1 (since 0 and 1 ID are the ground and the “killing wall” ID) and setting a custom DOP data to “true”.. but this doesnt happens..

here's a snip of the code I'm using to set the custom data:

set checksphere = `dopoption(dopsolvedopnet(), dopsolveobject($i), “Options”, “objid”)`
if ( $checksphere > 1) then
dopsolvesetoption -t bool $i myData isSphere true
endif


isSphere is always “0”, which is false.. and it should be “1”


since I'm aware I might be choosing the hardest and more complicated way… is there an easiets way to simply “kill” (like in POP) an RBD obj from DOP or SOP using collision data?

thanks a lot for any help.

cheers!
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Member
509 posts
Joined: July 2005
Offline
hm… I just did some more test.. and I found that

dopoption(dopsolvedopnet(), dopsolveobject($i), “Options”, “objid”)


always gives me “0” …. trying to figure out why…
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
The third argument to dopoption is a path to the subdata you are interested in. In this case, you want to look at the object itself, not any subdata of the object, so instead of “Options”, this argument should be “”.

Mark
User Avatar
Member
509 posts
Joined: July 2005
Offline
mtucker
The third argument to dopoption is a path to the subdata you are interested in. In this case, you want to look at the object itself, not any subdata of the object, so instead of “Options”, this argument should be “”.

Mark

Thanks a lot, that was the problem about the script.

I'm recently going a bit deeper into DOP and I'm just now really understanding DOP data and how to deal with (with hscript).

just to answer my original question … is there a way then to promote a DOP data into a SOP attribute?

cheers.
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
Yes, you can. Within DOPs you can use the SOP Solver DOP to modify the geometry data of your DOP objects using a chain of SOPs. There are several examples on the SOP Solver DOP help card. Or you can extract your simulation out into SOPs using a DOP Import or Object Merge SOP and put your attribute creation SOPs there (depending on whether it is important to have the atrtibute data available inside the DOP simulation).

Mark
User Avatar
Member
509 posts
Joined: July 2005
Offline
mtucker
Yes, you can. Within DOPs you can use the SOP Solver DOP to modify the geometry data of your DOP objects using a chain of SOPs. There are several examples on the SOP Solver DOP help card. Or you can extract your simulation out into SOPs using a DOP Import or Object Merge SOP and put your attribute creation SOPs there (depending on whether it is important to have the atrtibute data available inside the DOP simulation).

Mark
Hey Mark

I've looked at all the scriptSolverDOP and sopSolverDOP .. but I'm really confused (and a bit shocked) about the tricks and work that has to be done to simply get create an attribute from DOP after dopImportSOP or OBJmerge … I've seen those copy/stamp setups and I hardly believe that's the only way…

Mark, the only thing that I need to do .. is deleting objects that impact against walls .. like a killPOP.. but I'd like to do it in SOP after the DOP simulation is done.. using some attributes… I'm stuck. and I feel realu dumb!

thanks for any light shed on this.
cheers.
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
Well, “have I ever hit anything” is really something that involves the DOP object, not its geometry. So adding a geometry attribute to store this information is massive overkill (not to mention that it will slow down your simulation as SDFs need to be recalculated any time your geometry changes).

So I think a script solver is the way to approach this. Create some empty data on each object, add a Modify Data to initialize the “hasimpacted” field to zero. Then in the script solver if dopnumrecords on the Impact data of an object is more than zero, set the “hasimpacted” field on your custom subdata to one.

Then in SOPs, use the dop object name attribute created by the DOP Import SOP and a dopfield expression to access the “hasimpacted” field on your custom data for each primitive. Put this expression in a delete SOP to delete all primitives that are associated with objects that have impacted.

Mark
User Avatar
Member
509 posts
Joined: July 2005
Offline
well.. in my case I dont need to delete DOPbjects that hit anything .. I need to delete DOPbjects that hit a specific wall…

right now I'm using the “activate” method… I'm deactivating objects that hit the specific wall.. and in SOP trailing the speed and deleting promitives with zero speed value.

although I'm wondering about what you mentioned… how can primitives knows which DOPbjects belongs to? (basically an help on the dopfield SOP expression would be welcome )

also .. I tried, with no success, to change the “v” value in DOP to zero but seems not working (so I dont need the SOP trail) .. is there any way to do it?


thanks a lot!
cheers
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
well.. in my case I dont need to delete DOPbjects that hit anything .. I need to delete DOPbjects that hit a specific wall…

Well I think everything I said still holds true. The script solver script will just be a little more complex as it will have to loop through all the impacts instead of just checking for any impact. Four lines of script instead of two then

right now I'm using the “activate” method… I'm deactivating objects that hit the specific wall.. and in SOP trailing the speed and deleting promitives with zero speed value.

I didn't realize you were also de-activating the DOP objects. In that case you don't need a separate “hasimpacted” field. You can, as you are already doing, just look at the activate field on the ActiveValue data using a dopfield expression.

although I'm wondering about what you mentioned… how can primitives knows which DOPbjects belongs to? (basically an help on the dopfield SOP expression would be welcome )

The DOP Import SOP has an option (which is on by default) to set a primitive attribute that contains the name of the DOP Object used to set the position of each primitive. So you can use the primitive local variable “$DOPOBJECT” in your SOP expressions as part of a dopfield expression that accesses the active value. So in a Delete SOP set to delete primitives based on an expression, use an expression like (I'm making up the syntax here so you'll want to double check that I'm using the right parameters):

dopoption(“/obj/dopnet1”, $DOPOBJECT, “ActiveValue”, “active”) == 0

Which should cause the Delete SOP to delete primitives associated with any deactivated DOP Object.

also .. I tried, with no success, to change the “v” value in DOP to zero but seems not working (so I dont need the SOP trail) .. is there any way to do it?

If they are RBD Objects, use an RBD State DOP and set the velocity. Remember to use “Set Always” as the parameter operation for the Velocity parameter, and “Set Never” as the default operation so that you won't modify any other aspect of the object.

Mark
User Avatar
Member
509 posts
Joined: July 2005
Offline
thaaaaanks a lot Mark,

it gave me a huge kick in my dig into DOP … a lot.

I'm having problems with the SOP expression (it currently delete every primitive) but I want to try further more and understand what was wrong before asking back your help

but now a lot more is clear in my head. thanks!
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
Glad I could help.

If you do want more help, it would probably be easier if you post a hip file, if that's possible.

Mark
User Avatar
Member
509 posts
Joined: July 2005
Offline
ok Mark,
I sort of have to give up easily cause I need to move on…
I'm stuck with the dopoption SOP expression.

If I'm not wrong.. dopoption expects an object name as second argument.. while $DOPBOJECT gives the ID of such object.. and not the object name (in my case ball_3 has ID 6, for example)…

so basically I guess the expression:

dopoption(“/obj/dopnet1”, $DOPOBJECT, “ActiveValue”, “active”) == 0

is wrong?
i've tried to get the object name with several dop expressions.. but couldnt managed to get it sorted.. and the above expression always gives me 0 as result..

thanks again.
cheers!
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
As I said, I didn't have Houdini running when I tried that expression. So I got a few things wrong. First, $DOPOBJECT contains both the DOP Network and the DOP Object id, so passing it as the second parm won't work. Instead, you have to pass the whole DOP Data path (DOP Network, object, and subdata name) in the first parameter. Second, the “ActiveValue” subdata name was wrong. It should have been “SolverParms/ActiveValue”.

To answer your comment about object id versus object name, the second parm (if you are using it) accepts any object specifier, which means an object name or object id.

Anyway, here is a hip file that has a couple of RBD Objects and an RBD Auto Freeze DOP. Then it pulls the whole sim into SOPs and deletes any objects that are not active.

Again, if you have further problems, please post a hip file. It's much easier for me to edit an existing hip file rather than starting from scratch.

Hope this helps,
Mark

Attachments:
deleteinactiveprims.hip (113.7 KB)

User Avatar
Member
509 posts
Joined: July 2005
Offline
hm… simple question … then I'll prepare a sample HIP to finally show what I'm doing …
I now set active = 0 to the RBD i want to “disappear” in SOP … problem is.. that such DOPjects still affects others even if deactivated.

basically imagine a lot of balls falling down through a pipe.. and I need to remove balls that pass through an invisible wall ..
since I'm now deactivating such balls and then deleting them in SOP they affect the balls behind them by making them having crazy bounces .. instead of (as I would expect) pass throught the deactivated balls…


ok… confused enought? …

sorry for long text.. and hope it makes sense somehow.


cheers!
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Member
509 posts
Joined: July 2005
Offline
finally solved! …
using a sopsolver … (that I finally fully understood).

I'll post the scene as soon as I'll get one simple and light

thanks a lot Mark!!

cheers
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
I assumed that you wanted the other DOP objects to continue responding to the inactive objects in the scene. Otherwise I would have just suggested using the Delete DOP to delete the objects instead of making them inactive (which would avoid the whole problem of having to delete the geometry at the SOP level).

But anyway, I look forward to seeing the file.

Mark
User Avatar
Member
509 posts
Joined: July 2005
Offline
Ok Mark,

I did setup a scene that's really close to what I need to archieve.. and I'm nearly givin up.

what I need.. is bunch of sphere shaped object to rool down from a slider.. and sidappear when they hit a certain “obstacle” .. since I dont want such objects at next camera cut, no matter what. (reason is that I had to split the shot DOP into 3 dops to have a nicer overall movement.

here's the three main issues I'm fighting with:

- speed!! when using the sopSolver to delete primitives it takes ages, the sample scene of course doesnt (still much slower though) but my scenario have around 120 “spheres” and it becomes quite slow.

- collisions and shaking static objects, I'm having random behaviors when using or not using multisolver (the spheres compenetrates themself)… or having a single “slide” DOPbject or having it made by the different pieces.
sadly it seems I cant reproduce it now .. but looks like “mergeDOP” settings and “RBDsolver->computer compenetration” makes a big difference, problem is that sometimes I can fix the “shaky static objects” but then sphere doesnt collides with themself…
the current HIP file looks like it works.. but then.. the script doesnt.

- script, the current script (I have included the two script in the scriptSolverDOP->comments) gives me wrong “impact objects” names from the “otherobjsid” .. and cant understand why… this also changes a lot accordingly to the DOP network wiring and merge settings.

I'm really confused.. as I thought I've got the idea but I see myself still randomly wiring and changing options…. and since such scripts used to work on my actual scene I dont understand what's going on in here.
I created this scene cause in my actual scene I had the big shakying issue… but then I ended by being even more confused about the DOP setup.

it would be really great if you could have a look and point me to some obvious mistakes I'm falling into.

thanks in advance!

Attachments:
DOP_confusion.tar (170.0 KB)

JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Member
509 posts
Joined: July 2005
Offline
ok … constantly changing things and switch and parameters got me screwed…
I found why the script is not working at the moment ..
the reason I made this mistake (not setting the two static objects as “active”) is the result of trying to get rid of the shaky static object.

anyway .. enabling “set active object” into the two static objects make the script correctly work with IDs and names.

bah .. sorry.
cheers

now I renabled the sopsolver and the request for an alternative tat makes the whole DOP faster is still there .. thanks.

Attachments:
DOP_confusion.tar (170.0 KB)

JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
Lots of little details to improve here:

1. You ground object has massive divisions. For iterative development it can save a huge amount of time to use the option to save the volume data to a file. By setting it to “Automatic” mode, the first time the hip file is run the volume gets generated, but every subsequent time it loads from disk in about 1/50th the time. You could also consider breaking up your ground object into several separate objects (one per tube segment). Then you could easy position them within DOPs. I'd still use the volume file, but they could all share the same volume file.

2. The impKiller object also has very high divisions, but there is no reason for this. Cubes are easy to represent as a volume accurately, so I decreased the divisions to 10x10x10.

3. The Static Objects should not be active, and they should not be passing through the Multi Solver node. Otherwise they will get solved as RBD Object, meaning they will move when the spheres hit them. Not what you want, I assume.

4. The reason your script wasn't working when the static objects were not active was because of an error in the script. You were confusing OBJID with solve object index. In particular, these lines:
set -p curImpObjID = `dopfield(dopsolvedopnet(), dopsolveobject($i) , “Impacts”, “Impacts”, $j, “otherobjid”)`
set -p curImpObjName = `dopobjectlist(dopsolvedopnet(), dopsolveobject($curImpObjID), 1)`
were passing the impact “other object id” to the “dopsolveobject” function. This would only work if you made all your object's active, which would incidentally make the OBJID equal to the dop solve object index. Instead the second line is now:
set -p curImpObjName = `dopobjectlist(dopsolvedopnet(), $curImpObjID, 1)`
And the Static objects are inactive, and have no solver applied to them.

5. SOP Solvers, unless you use volume data files explicitly and carefully, or are very careful in the SOP Network, will slow RBD Simulations to a crawl. This is because on each timestep the geometry of each RBD Object gets modified (maybe an attribute value is set, maybe a tiny transform is applied). But _any_ change to the geometry requires rebuilding the SDF of every RBD Object. And when you had the ground object active, this also meant recalculating that huge volume data each step. Thus the slow simulation. So I replaced the SOP Solver (which would delete the Geometry of the object, but not the object itself) with a Group DOP and a Delete DOP. The killgroup DOP puts all objects marked for death into a group. The Delete DOP deletes those objects from the simulation.

6. The problem with the Delete DOP (and the SOP Solver) is that objects that are going to be deleted still hit the wall. This in turns affects all objects behind them and slows them down. But that wall isn't really a wall, as I understand it. It is just a point in space where you want to make the objects disappear. So rather than doing a collision with a script solver and a delete, I got rid og the impKiller object and just used an expression in the killgroup DOP to detect when the objects reach a particular point along the z axis. Because the objects don't hit anything, there is no inexplicable blockage of the objects behind. And it's very very fast. Your expression may get more complex if your impKiller doesn't happen to align with a world axis, but you should still be able to devise an expression. Don't forget to take into account both the object's position (t) but also its center of mass (p when determingin where each object is.

Hope this helps.

Mark

Attachments:
DOP_epiphany.tar.gz (22.0 KB)

User Avatar
Staff
4444 posts
Joined: July 2005
Offline
I just noticed you had a few different DOP networks in your file. I did all of my work in /obj/geo1/multisolver_DOP.

Mark
  • Quick Links