Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export Archive Primitive ID as Custom Shading Parameter?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Anonymous
1142 Views, 7 Replies

Export Archive Primitive ID as Custom Shading Parameter?

I trying to shade XGen primitives (created in Maya) in Katana as renderer procedurals. I need to export a custom shading parameter that I can use to access some form of ID for each archive in my description. E.g. Building a forest by instancing 4 trees and exporting an ID for each tree = four IDs total.

 

Is there an ID per archive that can be exported/accessed? If so, which one and how? I have tried id, faceid and geomid and had no success. 

 

Any help is greatly appreciated. 

 

 

7 REPLIES 7
Message 2 of 8
sean.heasley
in reply to: Anonymous

Hi @Anonymous and welcome to the community!

 

The easiest way to do this would be to use MASH and create the ID nodes that way.

 

So what you could do is:

 

  1. Create a Tree with xGen
  2. Turn it into a Primitive
  3. Use MASH to assign an ID node to the primitives
  4. Export to Katana

 

 

Please let me know if this helps or if you need any more assistance!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

Message 3 of 8
Anonymous
in reply to: sean.heasley

Hi sean.heasley,

 

Thanks for the speedy reply!

 

Unfortunately I think your suggestion is not quite what I want to achieve. Are you suggesting that I bring my XGen forest in to MASH and create IDs on the actual XGen archives? Or that I build my whole forest using MASH?

 

I think perhaps I was not clear enough in my explanation.

 

I really just need an XGen custom shading parameter that I can use to differentiate between the various archive index ids once in Katana. The steps I am taking right now are:

 

 - create three tree models

 - export each tree model as an XGen archive

 - add each archive to one single description, populate my surface with the three tree XGen archives

 - import XGen file in to Katana

 - ideally, use PxrAttribute node to read custom shading parameter(s) to help differentiate between the three XGen archives, thus far the ones I have tried use or create are not working

 

Thanks again for the help!

 

Cheers,


L

 

 

Message 4 of 8
sean.heasley
in reply to: Anonymous

Hi @Anonymous

 

Ok I understand what you're saying.

 

I'm not sure if you can link a shader for the IDs like that which is why I recommended MASH.

 

Its a somewhat similar workflow but you could actually use MASH entirely to create the forest and have the same amount of variation you're looking to do with the ID shader.

 

This video is an example of using maps to block out where objects can be based on a texture map.

 

 

 

This video can show you how to change what is placed where based on ID nodes and the Ecosystems set up.

 

 

 

 

Its a bit different then the way you were looking to do it but MASH is very powerful and should help you get some nice results!

 

Let me know if this helps or if you need any more assistance!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

Message 5 of 8
Anonymous
in reply to: sean.heasley

Thanks again Sean!

 

I will look through the MASH documentation to see if that is a viable option for our needs. 

 

Would you or someone else at support be able to confirm for me whether or not it is possible to export archive index id as a custom shading parameter. I am certain that if I can do that, I can use a PxrAttribute node to grab the value for each index and write an expression to drive things like colour assignment in the shader. This has worked for me with a "color" custom parameter set to randomize the colour on each instance:

 

$a=[rand( 0, 1 ,$id),rand( 0, 1 ,$id+1),rand( 0, 1 ,$id+2)];#-1.0,1.0
$a

But again, this is not what I want. I want a specific colour per archive index id.

 

If you are not able to confirm, would you be able to please pass me to someone who might or suggest someone at Autodesk to contact?

 

Thanks for all the help!

 

Cheers,

 

Message 6 of 8
sean.heasley
in reply to: Anonymous

Hi @Anonymous

 

I did some talking with our devs and it looks like this functionality isn't possible for exporting.

 

That said, I hope the resources I provided about MASH and how you can accomplish this similar effect are helpful for you!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

Message 7 of 8
Anonymous
in reply to: sean.heasley

Hi Sean,

 

Thanks for confirming that info for me. I've actually managed to get Rman primvars working so I'm ok for now.

 

Just to note, I'm surfacing and lighting in Katana so MASH isn't really going to work for me. As far as I can see, I would have to export to Alembic which negates any speed savings that I will get with a renderer procedural like XGen which I can bring in to Katana.

 

If there is a workflow for getting MASH in to Katana please do send me documentation. 

 

Thanks again,

 

L

Message 8 of 8
sean.heasley
in reply to: Anonymous

Hi @Anonymous

 

Yes alembic is one common option. You could also switch MASH geometry type to instances and then bake Instancer to objects. Then you can use your existing pipeline to transfer these objects to Katana.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report