20% Bonus On your First Rechargeclose
Search
Submit MethodUpload Method
Arnold Standalone
Need more help?
Tell us more and we'll help you soon.
Chat now with support
Chat now with support
SupportRendering TutorialMayaMaya Trouble Shooting
A brief talk about Nhair hair in Maya

A brief talk about Nhair hair in Maya

1. To avoid problems with Nhair, you must follow these rules 1. If the hair has dynamics, specify the cache, turn off dynamics, and delete (turn off) the simulation node 2. If the hair has no dynamics, turn off dynamics, and delete (turn off) the simulation node Nhair's hair simulation node, that is, the nucleus node, is generally deleted directly. Maya will automatically turn on dynamics when rendering in command line, which may cause a certain impact on Nhair hair rendering

动力学改为静态_有标记

关闭解算节点_有标记

2. 2. Dynamic 1. Display in Maya

maya内展示

Export cache (this step is generally solved). Before exporting the cache, turn on the hair dynamics and simulation nodes. Here provides several Python scripts here to change all nodes

Explanation

# Turn on all hair dynamics
for obj in cmds.ls(type="hairSystem"):
   cmds.setAttr((obj + ".simulationMethod"), 3)
   print obj, cmds.getAttr(obj + ".simulationMethod")
# Turn on all simulation nodes for obj in cmds.ls(type="nucleus"): cmds.setAttr((obj + ".enable"), 0) print obj, cmds.getAttr(obj + ".enable")

Select the hair node, nCache->Create New Cache->nObject, then set the export path, file format, etc., and then click “Create”

缓存输出_有标记

3. Turn off dynamics. Turn off (delete) the simulation node. Here is to turn off all nodes in the scene. Here  provides several Python scripts here

Explanation

# Turn off all hair dynamics
for obj in cmds.ls(type="hairSystem"):
    cmds.setAttr((obj + ".simulationMethod"), 1)
    print obj, cmds.getAttr(obj + ".simulationMethod")

# Turn on all simulation nodes
for obj in cmds.ls(type="nucleus"):
    cmds.setAttr((obj + ".enable"), 0)
    print obj, cmds.getAttr(obj + ".enable")

动力学改为静态1

关闭结算节点

4. Specify cache. If there is a cacheFile node, specify it directly. If not, use the following method. You can find that our file has no dynamics.

指定缓存

Now specify the cache. Select the shape node of the hair system.

image

Select: nCache->Attach Cache, change the settings, assign to the hair, and click “Merge”.

image

After merging, we click” Play” and we can see that the hair is dynamic. You can't see the dynamics by directly dragging the frame.

加载缓存后的nhair动态

5. Check whether the cacheFile path is correct or not.

Explanation

import maya.cmds as cmds
import os
all_image = cmds.ls(exactType ="cacheFile")
for a in all_image:
    b = cmds.getAttr(a+".cacheName")
    c = cmds.getAttr(a+".cachePath")
    print (c+"/"+b+".xml")

三、 No dynamics

 It is convenient to have no dynamics. Just use the tool to turn off all hair dynamics and simulation nodes.

Explanation

# Turn off all hair dynamics
for obj in cmds.ls(type="hairSystem"):
    cmds.setAttr((obj + ".simulationMethod"), 1)
    print obj, cmds.getAttr(obj + ".simulationMethod")
# Close all simulation nodes
for obj in cmds.ls(type="nucleus"):
    cmds.setAttr((obj + ".enable"), 0)
Can't find what you're looking for?
Contact us to get your issue resolved as soon as possible.
Chat now with support
Chat now with support
Business Consulting

Global Agent Contact: Evan Zhang

Email: evan.zhang@foxrenderfarm.com

Marketing Contact: Evan Liu

Email: evanliu@foxrenderfarm.com

Message Us:
Newsletter
Keep up with our latest software updates, special offers and events!
Copyright © 2025 FoxRenderfarm.com. All Rights Reserved.