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: 

Xgen interactive; expression to drive clump based on primitive length?

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
Lindsey_Robbins
2111 Views, 9 Replies

Xgen interactive; expression to drive clump based on primitive length?

Hello!

 

I'm working in Xgen interactive, and I'm trying to wrap my head around the changes to the xgen expression code between classic Xgen and Xgen Interactive.

 

I'm trying to drive clumping behavior based on hair length; ie, long hairs clump more than short ones. There's a great example in the help files using this code:

 

$a =$cLength;
$max =7.00; #0.00,10.0
clamp($a,0,$max)

 

However, this throws an error, as it's using $cLength, which (according to the help docs) isn't available for Xgen Interactive groom, though the $cWidth parameter is.

 

"$cLength  The final, computed length of the current primitive.

 $cWidth The final, computed width of the current primitive.   Note: Supported by Interactive Grooming Splines. "

 

So, how would I write an expression in the SeExpr Editor to drive clump behavior based on the current primitive length? Or does interactive not consider each hair a primitive, and therefore I need to use a whole other type of expression?

 

I'm still learning xgen code, so I apologize if this question is a little basic. I can't seem to find the answer myself. 🙂

9 REPLIES 9
Message 2 of 10

Hi @Lindsey_Robbins

 

I did some testing and I believe your initial assumption is correct and that this isn't available via IGS because the length expression doesn't work with IGS.

 

I believe the reason this is the case is because the length brush in IGS has a module sort of "set" settings while the width is a setting set by default but has a bit more options to tweak and change.

 

That said, you could achieve this functionality easily in standard Xgen since the length expression works there.

 

However if you need to work in IGS you could also look into simply painting maps for the clumping and/or use a map for the clumps.

 

 

Message 3 of 10

Thanks so much for the reply!

 

Ah, that's a shame. Having it auto clump based on length would be amazing, but I get why it doesn't work.

 

I've been controlling it through painted maps, but many of these characters are done with multiple UDIMs, so ptex is annoying. Just to confirm, though, there's no current way to get IGS to read or modify the hair length through expressions, correct?

 

Is there a simple way to get a completed groom (minus clumping) back to classic XGEN? Is it exporting guides from the IGS groom and just remaking it? Corollary to that, what's the easiest way to export IGS guides as curves? 

 

I love IGS so much, I wish it had all the functions of old XGEN.

 

 

 

 

Message 4 of 10

Hi @Lindsey_Robbins

 

We actually have an article on transferring the IGS hair to an Xgen description here!

 

As for your second question, I believe you can't export IGS guides as curves. I know you can do it with standard Xgen but I'm going to do some digging to make 100% sure you either can or can't do it with IGS.

 

 

Message 5 of 10

Ah, I see.

 

Message 6 of 10

I'm going to try to export the guide hairs as an alembic right now, we will see what I get!

 

(also, heck, you're fast. XD)

Message 7 of 10

Hi @Lindsey_Robbins

 

Ugh I forgot about alembic lol. That is an option that hopefully works so let me know how it goes.

 

And it's surprisingly a relatively slow day so I'm having an easier time getting responses out 😉 

 

 

Message 8 of 10

Can we lodge a request for a way for IGS to read length? It'd be super useful for all sorts of expressions, as I realize it is with XGEN classic.

 

 

Message 9 of 10

Hi @Lindsey_Robbins

 

Sure thing! You can post this on the Maya Idea Board!

 

This is a great place for the community to share ideas or feature they want to see in the future of Maya and this board is regularly checked by the dev team!

 

Please let me know if there's anything else I can do to assist 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 10 of 10

Alembic cache just brought in the guides as guides, and I can't convert them. Can't even make them into primitives! Grr. 😄

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

Post to forums  

Autodesk Design & Make Report