Alles Kleber Posted November 21, 2007 Share Posted November 21, 2007 Hi, I'm trying to get volume data from a fluid simulation via Dop Import straight into a composition with the same dimensions. I can see the volumesample() expression function but what COP node would let me run this per pixel? Is there generally a more elegant approach? Much appreciated! Quote Link to comment Share on other sites More sharing options...
edward Posted November 22, 2007 Share Posted November 22, 2007 Not sure about elegance but I think the Pixel COP lets you run expressions per pixel. Quote Link to comment Share on other sites More sharing options...
shikung444 Posted November 23, 2007 Share Posted November 23, 2007 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? Quote Link to comment Share on other sites More sharing options...
Alles Kleber Posted November 23, 2007 Author Share Posted November 23, 2007 Not sure about elegance but I think the Pixel COP lets you run expressions per pixel. 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. Quote Link to comment Share on other sites More sharing options...
Alles Kleber Posted November 24, 2007 Author Share Posted November 24, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jason Posted November 25, 2007 Share Posted November 25, 2007 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 Quote Link to comment Share on other sites More sharing options...
Alles Kleber Posted November 25, 2007 Author Share Posted November 25, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jason Posted November 25, 2007 Share Posted November 25, 2007 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 Quote Link to comment Share on other sites More sharing options...
Alles Kleber Posted November 26, 2007 Author Share Posted November 26, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.