dansidi Posted October 10, 2016 Share Posted October 10, 2016 (edited) Hi All, I'm sure this question must be a common one but I have searched this forum without finding the solution I need. So, apologies if I am repeating a previous post. Right. What I am trying to do it take some nParticles from Maya over to Houdini for rendering in Mantra. I am using Alembic to transfer the particles. Houdini finds the particle position, P, velocity, v, and particle ID, but not other per-particle data, such as rgbPP, lifespanPP, aimDirectionPP, etc, which I would like to carry across. I can see that some data is there in the alembic file, but Houdini does not seem to be translating it properly. Maybe you can see from the screen grab what is happening. rgbPP, for example, is coming in as a massive array of floats, the size of the array is three times the number of particles. I assume I need to wrangle the Alembic data in some way. I would be very grateful for some help with this. I am fairly new to Houdini, VEX is not something I am experienced with, except for the very basics. Maya 2016 Houdini 15.0.244 Windows 7x64 Many thanks, Dan Edited October 11, 2016 by dansidi adding more images Quote Link to comment Share on other sites More sharing options...
Atom Posted October 10, 2016 Share Posted October 10, 2016 (edited) You don't really need a Wrangle in this case, what you need is an AttributePromote. Promotion allows you to transfer internal data from one aspect of geometry to another.Such as transferring color from points to faces or faces to edges etc.. You can also rename the old attribute to a new name during the promotion process. Read the help card for more detail. In this image your case is shown. rgbPP is promoted from primitives down to points and renamed to Cd. This should make colors appear in the viewport if the particles were truly colorized in Maya. Edited October 10, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
dansidi Posted October 10, 2016 Author Share Posted October 10, 2016 Hi Atom, Thanks very much for your reply. Now, I have applied the attribute promote node to the alembic file, now I get a massive array of Cd on each particle. This is getting out of hand! Hopefully you can see from my screen grabs what is happening. In the spreadsheet, the Cd[n] columns go on and on until n = 3 * number of particles. What would you suggest I try next? Many thanks, Dan Quote Link to comment Share on other sites More sharing options...
Atom Posted October 10, 2016 Share Posted October 10, 2016 Cd should be 3 wide, not 1047 wide. Can you prepare your attributes better out of Maya? I don't use Maya so I'm not sure what options are there. Can you post an example Alembic with say only 10 particles for testing purposes? Quote Link to comment Share on other sites More sharing options...
dansidi Posted October 10, 2016 Author Share Posted October 10, 2016 Absolutely! You can have this little alembic file (1.6MB) It has a couple of hundred particles, each of which should have lifespanPP (single float), rgbPP (three floats). I have been trying to wrangle the data, but I'm not quite there yet. I don't know how to access arrays in VEX and get the data into a three-element array, for example Cd. I got this far: i@index = 3 * @ptnum; f@red = f[]@rgb_PP[@index]; f@green = f[]@rgb_PP[@index + 1]; f@blue = f[]@rgb_PP[@index + 2]; v@Cd = set(@red, @green, @blue); and I think I'm almost there. However this gives three attributes @red, @green and @blue but all are getting set to 0.0 I'm obviously not accessing the rgb_PP array properly. I am grateful for your help, I think we are almost at the end now... Cheers, Dan particleTest_v001.abc particleTest_v001.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted October 11, 2016 Share Posted October 11, 2016 (edited) int index = 3 * @id; float r = v@rgbPP[0]; float g = v@rgbPP[1]; float b = v@rgbPP[2]; //printf("%d,%d,%d\n", r,g,b); v@Cd = set(r,g,b); This adds some color to the particles over time but I think it is always fetching the first version of @rgbPP. I can't figure out how to get an all those values into the array so they can be indexed by @id. I think we need some kind of VEX array expert to display the correct syntax for such operations. Edited October 11, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
dimovfx Posted October 11, 2016 Share Posted October 11, 2016 Just put this wrangle after alembic node. vector rgb[] = prim(0, "rgbPP", 0); v@Cd = rgb[@ptnum]; 2 Quote Link to comment Share on other sites More sharing options...
dansidi Posted October 11, 2016 Author Share Posted October 11, 2016 That's it! Nice one Sasho. Thanks very muich! Thanks Atom too, I learned a lot! Quote Link to comment Share on other sites More sharing options...
Atom Posted October 11, 2016 Share Posted October 11, 2016 (edited) Thanks Alexander, that works! Daniel, you may want to play around with this variation. vector rgb[] = prim(0, "rgbPP", 0); v@Cd = rgb[@id]; I noticed while viewing the geometry spreadsheet that @ptnum gets reused by nParticles, probably Maya's version of Houdini's reaping. So when particle#0 dies, instead of keeping it around and taking up memory as a dead element, it is assigned a new id and given new life. Initially @ptnum and @id are identical. But once particles start dying and being reborn, @id falls out of synch and becomes a unique index into @rgbPP. Edited October 11, 2016 by Atom 2 Quote Link to comment Share on other sites More sharing options...
Martin B Posted April 30, 2018 Share Posted April 30, 2018 Bumping this old thread in the hope that someone sees it. I'm having trouble getting Maya to export PP attributes, P, V and ID are there in Houdini but nothing else. (They're not there as primitive attrbs that I can promote yet) So I think I'm missing something on the Maya side, but there's not really any options on the Alembic export. I'm trying to bring across some of the firework's examples that are in the Content Browser for a quick turn around job. Cheers Martin Quote Link to comment Share on other sites More sharing options...
Martin B Posted May 1, 2018 Share Posted May 1, 2018 Don't worry, you have to list the attributes in the alembic export window but I was naming the wrong. They also seem to go into the detailed field in houdini instead of the primitive list like above, but reckon I can figure it out now 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.