magneto Posted January 27, 2013 Share Posted January 27, 2013 (edited) Hi, I want to save a matrix3 as a detail attribute temporarily. How can I do this? I can't do it with AttribCreate, nor there is a Detail SOP. Is this not possible? I can't create it on points and promote it from there though because then for 1M points, it will take 1M iterations. I only want to store a hard coded value. So it doesn't really exist anywhere. Thanks Edited January 27, 2013 by magneto Quote Link to comment Share on other sites More sharing options...
kgoossens Posted January 27, 2013 Share Posted January 27, 2013 Yes you can using the attributeCreate node. Just type the nr of channels manually. MatrixAttribute.hipnc Quote Link to comment Share on other sites More sharing options...
magneto Posted January 27, 2013 Author Share Posted January 27, 2013 Thanks, that's what I did too, but how do you set the values of individual components after that? Quote Link to comment Share on other sites More sharing options...
kgoossens Posted January 27, 2013 Share Posted January 27, 2013 And by using a vopsop? MatrixAttribute2.hipnc Quote Link to comment Share on other sites More sharing options...
magneto Posted January 27, 2013 Author Share Posted January 27, 2013 That's exactly what I mean in my first post. My incoming geometry is very heavy, adding a point attribute for the matrix that will be the same value for each point and promoting it after that is very nonoptimal IMO. I was hoping a direct way to set the detail attribute values. Quote Link to comment Share on other sites More sharing options...
kgoossens Posted January 27, 2013 Share Posted January 27, 2013 (edited) But is there no way for you to have a separate point object where you can store that information? promote it there and then do an attribute transfer? Do you have an example scene for me to test with? Edited January 27, 2013 by kgoossens 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted January 27, 2013 Author Share Posted January 27, 2013 Thanks, I could do that, but even though I said temporary, I didn't mean it's only used once and then deleted. I meant it's added onto your incoming geometry and then modified slightly and then that version is kept forever, unless you delete it yourself. I could make an example file, but it's basically this: [incoming geo] -> [add matrix3 detail attribute] -> [do some trivial operations] -> [modify the matrix3 detail attribute] [out of subnet] ... [next incoming operators] So in the end the detail attribute should stay on the actual geometry. Sorry for being clear about it, because your temporary 1 point vopsop method would work otherwise. This is the bit that deludes me Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 27, 2013 Share Posted January 27, 2013 You can use detail string attribute and store your matrix as string. then use matrix expression function to convert string to matrix and then use explodematrix, explodematrixp to extract components. Here is example where i got the obj transform, stored it as detail string attribute and then transformed back at sop level: 3ak_store_matrix_as_attrib.hipnc 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted January 27, 2013 Author Share Posted January 27, 2013 Thanks, that's an interesting idea. I was thinking of using python to create a new operator just to do this. Although in your method, I won't be able to store the final detail attribute as float9, right? So using it via a string or a temporary point attribute like Kim suggested works to modify the value, but in the end I would really like to have it as float9. IMO the AttribCreate SOP interface should show additional components if the size is greater than 4. Then none of these workarounds would be needed. Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 27, 2013 Share Posted January 27, 2013 I think everything > 4 floats is intended to store as string. that's why there is bunch of expression functions to extract, convert from/to string. As for the python, you're definitely better at it so i may guess only if it's possible to store array of floats per object (using your own python node for that). Quote Link to comment Share on other sites More sharing options...
magneto Posted January 27, 2013 Author Share Posted January 27, 2013 Thanks, yes it's possible to do it in python, using: hou.Geometry.addAttrib which both allows you to specify the type of the attribute but also a sequence of floats. Are you sure about everything >4 to be strings though? Because adding a matrix/matrix3 point attribute actually saves them as float16 and float9 respectively. It's just that the non-point attributes don't seem to have that UI support. Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 27, 2013 Share Posted January 27, 2013 i meant attrib create SOP where you can add int, float, string and vector types only. M3 and M4 types are only through vop sop (and only for points of course). But i don't know why) Quote Link to comment Share on other sites More sharing options...
magneto Posted January 27, 2013 Author Share Posted January 27, 2013 Thanks man, I see what you mean now Hopefully SESI will add this to H13 because it's a pretty simple idea and I don't see any reason not to. Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 27, 2013 Share Posted January 27, 2013 12.5 would be better) 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted January 27, 2013 Author Share Posted January 27, 2013 I like your thinking 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.