Jump to content

Fluid Volume Data To Composition Context, How?


Recommended Posts

There's an example, it might help; I can't remember if it's from the houdini help examples or something from one of these forums.

It took the density from a metaball in sops and showed it in real time in a cops network. Does anyone know where I could find that example file again?

Found it. It's called SimpleMetaImport.

$HFS/mozilla/documents/examples/nodes/vop/metaimport/SimpleMetaImport.otl

Link to comment
Share on other sites

Excellent. Pixel COP & volumesample() works a treat. Thanks Edward!

Hi shikung444, thanks, I see if I can find it. Would be sure interesting how they generally go about it.

Hi there,

You could probably build a VEX COP and use the VEX volumesample() equivalent- which should execute a lot faster and give you some easier ways to transform your coordinates around than using the expression function.

Cheers,

Jason

Link to comment
Share on other sites

Hi there,

You could probably build a VEX COP and use the VEX volumesample() equivalent- which should execute a lot faster and give you some easier ways to transform your coordinates around than using the expression function.

Cheers,

Jason

Hi Jason,

I tried to do that according to the basic approach in SimpleMetaImport but if I build it from VOP nodes the file parameter does not translate to VEX code for some reason.

// Code produced by: volumesamplefile1

volumevalue = volumesample("", 0, xformpos);

I had a go at just doing a VEX type compositing operator and hard coding the file name but it seems the graph is not pulled correctly on frame change and Houdini occasionally goes in an infinite loop.

That's the code I tried in Houdini 9.0.747:

cop2
volume_sample_cop()
{
    vector sample_pos;
    sample_pos.x = ( X - 0.5 ) * 5;  
    sample_pos.y = ( Y - 0.5 ) * 5;  

    float val = 0;
    val = volumesample("op:/obj/smoke_object1/dopimport1", 0, sample_pos);

    R = val;
    G = val;
    B = val;
}

Not sure what's going on.

volume_sample_04.hipnc

Link to comment
Share on other sites

Hm, it sounds like you are running into some bugs, maybe?

However, I see one bug in your code: it'd be a good idea to initialize your sample_pos vector to zero ("vector sample_pos = 0;") since sample_pos.z is never set before you perform your volumesample(). This would no doubt cause odd behaviour in your return value -but obviously shouldn't cause the other problems you describe.

Perhaps you could report these findings here? http://www.sidefx.com/index.php?option=com...&Itemid=239

SESI is usually very quick at repairing any glaring H9 bugs - and if it is indeed a bug, would probably have you up and running in a matter of days.

Cheers,

Jason

Link to comment
Share on other sites

Hm, it sounds like you are running into some bugs, maybe?

However, I see one bug in your code: it'd be a good idea to initialize your sample_pos vector to zero ("vector sample_pos = 0;") since sample_pos.z is never set before you perform your volumesample(). This would no doubt cause odd behaviour in your return value -but obviously shouldn't cause the other problems you describe.

Yes, explicitly setting it to zero doesn't change this behavior. I completely agree that it's generally a good idea to initialize. Though, the VEX vector seems to get initialized in the standard constructor if you later check it using printf("%f", myvec.z).

Btw. is there some kind of debugger for VEX or extended options for compiler error reporting? All I ever get is "<unknown> Error(-1): Expecting open brace".

Perhaps you could report these findings here? http://www.sidefx.com/index.php?option=com...&Itemid=239

I've sent it off.

Thanks a lot for helping out.

Link to comment
Share on other sites

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