Jump to content

Gradual Fall of Objects


Netvudu

Recommended Posts

Hey, I have three spare days so I´m taking the chance to properly study some DOP stuff I (clearly) was lacking on....

So, now the topic is, I want to throw in some fractured object into DOPs, but I want it to fall down gradually, not the whole thing in one go...what´s the recommended workflow?

Here is a simple scene with four boxes and I want them to fall one by one, preferably in a method that I can afterwards use for more complex situations (shattered objects for instance). I was trying to use a box as some sort of activator for the dynamics transferring an attribute...something that works nicely for SOPs and POPs, but obviously doesn´t work so nicely for DOPs.

If you check my scene, you´ll see I went literally bonkers trying to make this work. I tried all kind of group things with gravity, with dopfields, dophasfield, dopoption....you name it.

I also tried creating an attribute from SOPs and then calling from DOPs, but that didn´t work either...

At this point I´m willing to accept any ideas on how this is usually done. I´m sure it isn´t tough, only I must be approaching it the wrong way.

GradualFall.hipnc

Link to comment
Share on other sites

Oops, didn't see your attachment there.

Got it working in your scene!

What I did was made points in your geo -- one point for every object. The point numbers should correspond to the primitive group name and therefore the dops object name. On those points I put an integer attribute, for the activation (just promoted Cd to a detail attribute in max mode to get whether it was active or not.)

In dops, I put a python expression on the group node to get the point attribute and put the corresponding object in the group if the active atrr is == 1. Then used the group in the modify data node to activate the objects.

Seems clean enough to me! Enjoy!

GradualFall.hipnc

Link to comment
Share on other sites

hi Sam,

it´s quite clear as you said, and it works indeed. I admit I feel a bit...unsatisfied by the solution, because I somehow doubt it´s not possible to do this without resorting to Python (even if it´s a few lines, as in this case).

One thing that frustrates me from DOPs is that, according to the details view I can see all the information from the Geometry, including its attributes, but I cannot reference to those, because if I use a point expression I can only call $OBJ or $OBJID or other similar variables, but not $PT. If i use a dopfield expression, then I apparently can´t call what´s under the field of Geometry...or maybe I´m doing so but it has no effect on the simulation...

It all looks and sounds extremely un-houdiniesque to me. Not being able to access and pass information from some other part of the app without resorting to Python? First time I´ve seen it. In fact I´m sure there´s a way..but I haven´t found it...yet...

But again, thanks. What you suggest does work flawlessly. It´s not something I would like to show to someone new to the software, though...

Edited by Netvudu
Link to comment
Share on other sites

You could add a sopnet inside the dopnet, have a dopimport in there and use point() to reference that ... still a bit wierd though!

There should be a way to reference the geo directly .... I don't know how though ... :/

Edited by sam.h
Link to comment
Share on other sites

There should be a way to reference the geo directly .... I don't know how though ... :/

exactly my thoughts!!...

I´m also asking at the mailing list, to check any other ideas. I will probably try also the sopsolver way as it sounds more native, even if obviously slower than the python solution.

Link to comment
Share on other sites

Hey Sam (and others). At the mailing list I received this scene from Sean Lewkiw which was a great and a reeeally simple way to solve the problem simply by changing the glue impulse and the glue threshold parameters with a Modify Data DOP and reading the color at SOPs.

I think it´s even simpler than your solution and it doesn´t use Python (not that using Python is bad at all, quite the contrary :) ).

At this thread at SESI´s forum you can find his original scene.

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=21377&highlight=

As Sean´s scene has a lot of secondary options and nodes that weren´t really needed for the basic stuff I recreated a simpler one just in case anybdoy wants to check a simple version on how to unglue pieces from a fractured object. I´m really happy about this setup because it´s a great way to reference SOP nodes from DOPs, and it doesn´t get any simpler than this. It´s entry level stuff and it works wonders.

My scene also has some post-its around to comment the key stuff just in case anybody is relatively new to DOPs.

Hope this helps someone else the way Sean´s scene has helped me.

Unglueing_SOLVED.hipnc

Edited by Netvudu
  • Like 1
Link to comment
Share on other sites

  • 8 months later...

I just wanted to say a quick thanks for posting your solution it has really helped me out.

I did it slightly different in that I used the colour attribute to change the Active value rather than the glue value.

I was wondering if I could ask your advice on something. I am using your method on a object that I have used the voronoi fracture sop using a scatter node as an input. As I used a scatter node from the source geometry I already have a point at the centre of each piece, however the point numbers do not seem to match up with the OBJID, is there a way to make them or reorder them so they do?

Its not a major issues as using a for each as with your method solves the problem just thought seen as I already have the points would be nice use them rather than having to recreate them.

Cheers.

Link to comment
Share on other sites

  • 3 weeks later...

I also would like to thank you for posting this scene. It helped me out alot too.

I found a way to ensure that the point numbers match with the DOP objects.

In the expression in the scene file:

point("/obj/Boxes/_TRIGGER",$OBJ,"Cd",0)*10

replace $OBJ with

dopoption($DOPNET,$OBJID,"CopyInfo",copynum)

and in the Group Mask, put something like `dopobjscreatedby("../rbdfractureobject1")`

This CopyInfo data is like an ID number for the objects created by an RBD fracture object, so its more reliable than using $OBJ or $OBJID. Adding new objects into the DOP network by dynamic fracturing can screw up your OBJ order and cause mis-matches with your SOP points.

Edited by Ryan
Link to comment
Share on other sites

  • 1 month later...

First let me thank everyone since this thread is extremely helpful.

Ryan, I am building a set up that uses a fractured object modeled in Maya, exported as an obj and fractured in Houdini.

I think my problem starts in `dopobjscreatedby("../rbdfractureobject1")` part

when I put this into the rbdfractureobject group mask it stops bringing my fractured Geo into the DOP network unless I ad the * before it, but I think this kinda defeats the purpose of what you are doing, and it still wont work.

I am attaching my scene file in case someone can figure out what I am doing wrong.

Thanks

highway_v01.hipnc

Link to comment
Share on other sites

  • 1 month later...

I fixed your file, I would like to thank you big time, as I have been searching for more than a month how to do that effect.

I looked at the example files you posted, as well as your bridge.hip file, compared them, and found out what was wrong without really understanding the scripting part.

-I edited the foreach node

-Cut the color node from the ACTIVATE node to the bridge node(not needed, but i wanted a faster feedback without changing node)

-I changed the attribute condition (higher distance threshold) your file is big so u need to adjust it

-copied the unglue activation from the example file to your file

Well it works, I will be studying more deeply those script and file to fully understand the process.

In the file you will find sticky where I say what I modified.

enjoy as i will!

Also can anyone explain us what the script in the value parameter in the UNGLUE node in DOP means

thank you

PS: now i might be able to destroy stuff the way i want in a simple way

thanks again for the example files, they are of great help

sorry for my awful English

FR3D

highway_v01_fixed.hipnc

Edited by FR3D
Link to comment
Share on other sites

Here is another version

using this time RDBfracture object

the result is the same here, but i believe the RBDglue one would be more interactive with other object, still have to test the differences

this one is a lot simpler than the glue version

cheers

Fr3D

highway_RBDfracture.hipnc

Edited by FR3D
  • Like 2
Link to comment
Share on other sites

  • 4 months later...

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