XGen no collision

XGen no collision

Anonymous
Not applicable
5,571 Views
15 Replies
Message 1 of 16

XGen no collision

Anonymous
Not applicable

Hi, I have a problem

 

I created hair with XGen with guides and created hair system. But when I play the simulation, the xgen hair doens't collide with the mesh. I already put the Collision Modifier, exported the mesh in alembic's file and imported it in the modifier but is not working, even I put two Collision Modifier. And I make the mesh a passive collider.

 

Anyone know what's wrong?

 

0 Likes
5,572 Views
15 Replies
Replies (15)
Message 2 of 16

Michael_Todd
Alumni
Alumni

Does the Log give any errors?

 

LogSettings.png

 

2015-10-17 17_46_57-.png



Michael Todd

XGen Product Owner and Designer

0 Likes
Message 3 of 16

Anonymous
Not applicable

I don't think so, it show me 0.

 

 

 

Oh, I have another question, how can I see the VRay on the Preview/Output tab? In my file of the model head appears but in the sphere doesn't appear.

0 Likes
Message 4 of 16

Michael_Todd
Alumni
Alumni

the Numbers indicate the verbosity levels of the log report. 0 means the log is effectively off. Set the log level to 2 or higher to get more details on what XGen is doing when you preview a description.

 

You have to set the renderer and assign a VRay shader to the description to get the hair to render

 

XGen and V Ray

 

XGen V Ray Tutorials

 

 

 



Michael Todd

XGen Product Owner and Designer

0 Likes
Message 5 of 16

Anonymous
Not applicable

This is what show me in the Log. What do you recommend? I'm thinking to make the hair again but I really don't want to 😕

0 Likes
Message 6 of 16

Michael_Todd
Alumni
Alumni

It looks iike you have spaces in the file path for a cache file. Spaces in files and folder names are not advisable in general. You should use _ rather than a space.

 

The spaces are causing the search for the cache used in the collision to fail.

 

Cheers



Michael Todd

XGen Product Owner and Designer

0 Likes
Message 7 of 16

Anonymous
Not applicable

So, I have to put more guides? If it that, I have to make the guides again.

0 Likes
Message 8 of 16

Michael_Todd
Alumni
Alumni

No, you have spaces in the name of a folder in the path to the cache file for the collision object.

 

/Compu personal/Maya/VRay/XGen/2 - Cabeza/

 

won't resolve, the spaces are not supported in file and folder names and are generally to be avoided, not just in XGen.

 

/Compu_personal/Maya/VRay/XGen/2_Cabeza/ 

 

would work. Use underscores to separate_words rather than spaces.

 

Cheers

 



Michael Todd

XGen Product Owner and Designer

0 Likes
Message 9 of 16

Anonymous
Not applicable

I change the spaces for "_" but still not working, I set it in another folder and nothing works.

 

I think maybe I have to make the scene again I that would be stressfull, there is anything I can try?

0 Likes
Message 10 of 16

Michael_Todd
Alumni
Alumni

Can you send me the scene to look at? It's probably just something you've overlooked...

 

Use the Archive Scene tool to make a zip file:

 

ArchiveScene_b.png


Cheers



Michael Todd

XGen Product Owner and Designer

0 Likes
Message 11 of 16

Anonymous
Not applicable

Here is. I used Renderman.

0 Likes
Message 12 of 16

Michael_Todd
Alumni
Alumni

What is the problem with this scene again?

In the scene you sent, there is no collision modifier set up in the modifier section. 

 

Adding a collision modifier and setting up a cache to drive it gives the expected results. 

 

Collision.pngCollisionRender.png

 

Could you give me an idea of the problem you're having with this scene, it would be great.

 

Cheers

 



Michael Todd

XGen Product Owner and Designer

0 Likes
Message 13 of 16

Anonymous
Not applicable

I'm sorry, I was thinking in a solution that I send the wrong file.

 

Here is, the model is a head and have a collision modifier with the alembic file. I used Vray.

0 Likes
Message 14 of 16

Michael_Todd
Alumni
Alumni

OK...

 

Several things to note

 

First, the scalp object has transforms on it and ideally the transforms should be frozen as XGen uses the untransformed object postions and scale as to generate a pref that forms the basis for determining density and other parameters. You should freeze the transforms on the scalp as having the scale on the object can mess up the guide placement (which seems to be happening in your scene)

 

You should delete your current guides and the xgen pref from the scalp geos shape node:

 

pref.png

 

Freeze the transforms on the scalp and save the scene and reopen it to force xgen to regenerate the xgen pref in the correct space.

 

Make new guides from the hairsystem output curves:

 

Curves2Guides.png

 

 

 

 

Second, you have set a high spline segment count but a low modifier CV count. This should be the other way around

 

SplineSegments.png

 

ModifierCVCount.png

 

The one that needs to be high is the Modifier CV count as 5 cv's for collision is too low for the length of hair and the shape of the head. The Spline segment setting is effectively a subdivision of the modifier cv count and is more of a render setting than an evaluation setting.

 

 

HighModCVCount.png

 

LowSplineSegment.png

 

Third, I'd recommend not parenting the scalp to the joint. In general this should be ok, but it might be better to simply shrinkwrap the scalp to the head as a deformer keeps the connections 'Dirty' in that Maya has to evaluate the changes every frame. You could make a copy of the scalp geo and keep that parented to the geo and use a blend shape to drive the geo xgen is bound to as well. 

 

Having done this the collision results are much better:

 

CollisionWorking.png

 

Fourth, I'd recommend adding more guides and making a new hairsystem (delete the entire hairsystem, nucleus and any rigid bodies and remake them again after adding more guides.) This will improve collision fidelity between the guides and the mesh  and give you more control over the shape and interpolation. New guides will be interpolated between existing guides, so there's little need to reshape them after adding new ones,

 

also, is there a reason why you are using VP 1...

VP1.png

 

rather than VP 2?

VP2.png

 

CollisionRender2.png

 

I don't have VRay loaded in this version of Maya, this is an Arnold render.

 

I hope this helps

 

Cheers

 

 

 

 

 

 

 

 

 

 

 



Michael Todd

XGen Product Owner and Designer

0 Likes
Message 15 of 16

Anonymous
Not applicable

I'm sorry, while I'm working with XGen I'm learning too. What do you mean with hair system output curves? Only I have to create curves and put them like Curves to Guide? And what is the VP, and the difference between 1 and 2?

 

By the other side, I made another file from zero, freeze the transform of the scalp, create curves, put them like guides in xgen, and everything work fine. But the density has to be 10, I don't know why but with 10 is a lot of hairs.

 

About the simulation, in the viewport I can see the collision but to make that sure I render, obviously, but doesn't appear. This time I use Renderman, I already set it, with the materiales of renderman. The collision is fine, I think, but no render 😕

0 Likes
Message 16 of 16

Michael_Todd
Alumni
Alumni

The Output curves from the nHair system 

 

OutputCurves.png

 

Select the curves themselves, not the group then use the curves to guides utility in XGen to make guides from them. 

 

CtG.png

 

The Density doesn't have to be 10. Density is calculated as the number of primitives (hairs) per unit area, which in XGen is always CM. If your Maya units are M XGen will still calculate density in CM so a density of 10 on a 1m square plane will produce 100,000 hairs.

 

Also, there are three density settings to consider, the generation Density on the Primitives Tab, the Preview Density and the Render Density on the Output tab

 

The Generation Density set how many primitives XGen will create on a given get of faces based on their surface area.

The Preview Density can be set to only draw a given percentage of those hairs in the Viewport

The Render Density will set the percentage of the generated hairs to send to the renderer.

 

When rendering with animation, you need to generate a cache for the XGen Patch, the geo that XGen is bound to:

 

Export patches.png exPatches.png

 

if you are using simulation curves to drive the guide motion, you need to make an alembic cache of the curves and turn off live mode  in the Guide animation section and point to the curve cache:

 

CurveCache.pngCurveCache2.png

 

You'll need to set which renderer to use on the output tab:

 

renderer.png

 

The XGen documentation covers all these topics:

 

Animating XGen Guides

 

Cheers

 

 

 



Michael Todd

XGen Product Owner and Designer

0 Likes