Announcement

Collapse
No announcement yet.

Vray fur and particle systems / Python

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vray fur and particle systems / Python

    Hi,

    So I am currently trying to find the best solution for my problem. I am using vray fur to add a type of sugar coating for my animated geo that I am lighting. In one scene there is a particle instancer instancing being used to duplicate the model hundreds of times. I am trying to figure a way to add the fur to the instanced particles if possible. I did add the fur to the source geo for the instancer but expecting didnt work. I am wondering if there is a way to accomplish this or maybe a post pythong script that could add it to the instanced geo once translated.

    Michael

  • #2
    You can do it with a python script.

    This is how I've done it
    1. Create particle system
    2. Create a plane
    3. Create an instancer with the plane
    4. Use this script in the post translate field:
    Code:
    from vray.utils import *
    import maya.cmds as cmds
    
    nodes=findByName('pPlaneShape1@node')
    fur=create('GeomHair', 'instanced_fur')
    if not nodes:
      cmds.error("Can't find the node")
    elif fur:
      mesh=nodes[0].get('geometry')
      fur.set('mesh', mesh)
      fur.set('length_base', 1)
      fur.set('gravity_base', -3)
      fur.set('gravity_vector', Vector(0,1, 0))
      fur.set('length_base', 1)
      fur.set('bend', 1)
      fur.set('thickness_base', 0.05)
      fur.set('dir_var', 0.2)
      nodes[0].set('geometry', fur)
    You'll have to modify it a bit, because the name of the plane might be different ('pPlaneShape1@node').
    Also you'll lose the ability to tweak the fur interactively in the UI.
    V-Ray developer

    Comment

    Working...
    X