David Larsson
April 9, 2015 19:37:54
Hi,
I've been trying to create assets for geometry processing inside of Maya and it seems like all material bindings are lost after creating the asset.
I created a null-asset for geometry processing (doing only an empty attribute wrangle).
When sending a mesh through the asset it inside of houdini all material bindings are preserved but when importing the asset in Maya and sending an object with materials through it comes out with lambert1 assigned.
Is it possible to send a geometry with materials through a houdini asset and have them preserved?
awong
April 10, 2015 11:53:11
The material information from Maya is not translated into the asset. This means when the asset outputs the geometry, there's no information on what the “original” material is. So Maya materials can't be preserved at the moment.
What we probably need to do is pass some information into the asset. Then, when the mesh node is created for the output by sync, we'll use this information to replicate the material. Off the top of my head, this could be done in two ways. Both are quite similar:
1) Store the name of the input Maya node as a detail attribute. Then when the output nodes are created by sync, it can find the input Maya nodes and use it as reference nodes to assign materials to the output nodes.
2) Store the material names directly as primitive attributes (and maybe detail attributes). Then, when the output nodes are created by sync, use the attributes to assign the materials to the output nodes.
David Larsson
April 10, 2015 13:34:19
Thanks for your answer!
HoudiniKitchen
April 15, 2015 07:03:11
I like the second option because it could give the opportunity to play about with the material names in the asset.
NakedChicken
June 16, 2015 16:02:08
Is this an update we can expect soon? If not, has anyone found a work-around yet?
awong
June 16, 2015 16:14:26
I don't have a chance to work on this yet, unfortunately.
NakedChicken
June 16, 2015 16:36:45
And am I correct in gathering that there still is no way of sending maya attributes through (other than color)? I've gone through the forums and such and haven't found any successful attempts.
awong
June 16, 2015 16:50:56
NakedChicken
And am I correct in gathering that there still is no way of sending maya attributes through (other than color)? I've gone through the forums and such and haven't found any successful attempts.
Yeah, there's no way send arbitrary attributes at the moment. It would be a good feature to have though.
NakedChicken
June 16, 2015 16:53:17
Agreed.
As a workaround I saw that people were using Alembic exports to bring arbitrary attributes across. Apparently this used to work, but not so in 14 (which I am indeed seeing, can't get it to work no matter what I try). Anyone found a way to make this work in the newest Houdini?
awong
June 16, 2015 18:13:21
NakedChicken
As a workaround I saw that people were using Alembic exports to bring arbitrary attributes across. Apparently this used to work, but not so in 14 (which I am indeed seeing, can't get it to work no matter what I try). Anyone found a way to make this work in the newest Houdini?
Hm, I gave it a quick test just now, and it seems to work. See the attached zip file. In the scene file, there's a sphere (test_sphere) that has a point attribute “foo”. I exported the sphere into an Alembic archive. Then, read it back with an asset. In the asset's sphere, the “foo” attribute is imported back into Maya.
Maybe you didn't unpack the geometry after loading the Alembic file into the asset? When Houdini import the Alembic archive, the custom attributes (and other things) are “packed” away inside the primitive. Since you need access to the custom attributes, you'll need to “unpack” the geometry.
Konstantin Kovalenko
April 11, 2019 09:56:03
hi all, its been a long time and the houdini engine still weak for maya, anyway, im trying to create an asset for maya through houdini engine that doesnt lose materials after reload asset as you discussed above but i dont understand how to make it correct cuz its not working
i even found this doc, still dont get it, i created an attribute s@shop_materialpath = “test”; from wrangle, and it supposed to link to the same name of material when i load this asset in maya? or no?
https://www.sidefx.com/docs/maya/_maya__material.html [
www.sidefx.com]
awong
could you please send a hip how did you make it? would be awesome!
if you still work in houdini after all these years
juliap
April 11, 2019 12:59:53
Take a look at the spaceship example (on Orbolt) This should come into maya with a phong shader with mapped color, and transparency and some other attributes. Note that the textures/colors do need to be baked out as maps, so that Maya can access them as file textures.
Konstantin Kovalenko
April 12, 2019 03:13:01
thanx i found, but there is just a default phong shader, it creates by default, i made it before, but our artists uses a vray, and it needs to be vray material, i dont know how this phong shader works with vray, and i hoped maybe there is a way linked some custom materials on asset and without loosing it after reload, i tried extract outside geo Material parameter to an assets that we could pick it in maya, but it didnt work cuz maya doesnt recognize this input as a material, only for mesh stuff
and even more problems, after reload an assets it creates a new shader and material phong every time, so if u reloaded it hundreds times there will be a hundred shaders
juliap
April 12, 2019 18:20:20
You're right, there is currently limited support for creating Maya shaders to match Houdini shaders. I've entered a bug for failure to delete old shaders, and an RFE for support for Vray shaders. Oddly enough, the docs say that we create a blinn shader and not a phong, so I will update that as well.
If you want to preserve information about edits that have been made to the asset's outputs and reapply them after sync, you can use the preSyncCallback to cache the information, and the postSyncCallback to re-apply the edits.
Konstantin Kovalenko
April 15, 2019 02:20:34
Cool, at least we have callbacks, but is there an example how to use it? im not so strong in scripting especially mel, python sometimes is ok
juliap
April 15, 2019 10:49:13
There's an example in the maya scripting doc, although it deals with caching and restoring parm state, rather than output state.
https://www.sidefx.com/docs/maya/_maya__scripting.html [
www.sidefx.com]
Konstantin Kovalenko
April 15, 2019 11:01:38
Thank you. but actually i saw it, and i didnt get how to use it properly, i mean where to put those scripts, i know there is Callback Script inside asset in houdini assets, but im not sure this is it, and if so what to put here?
we have three scripts and where to put each one? this is the main question
juliap
April 15, 2019 12:12:17
Oops, sorry, those callbacks go on the Maya side rather than the houdini side of the asset. I will make that clearer in the documentation. The names of the mel scripts go in string attributes on the asset node in maye, the scripts themselves should go in mel files of the same name somewhere on your MAYA_SCRIPTS_PATH. You can find the attrs in the AssetCallback block on the asset node in the Attribute editor.
I agree, in a lot of ways it would be more convenient if the scripts themselves could be encapsulated in the asset itself (e.g. as default parm values or something) But the you get into a chicken-and-egg kind of problem. You can't run the scripts from houdini since engine is always running out-of-process, and you can't get at the parms until the asset has been sync'd. So you're forced to do at least one sync before having access to the scripts anyway.
Having the procs be normal mel scripts in normal mel files does make it easier to debug the scripts and to share them between scenes and assets, and avoids the risk of having multiple assets with different variants of the same script.
juliap
April 17, 2019 15:14:28
The proliferation of output materials when there is a file texture present has been fixed in 17.5.230.