Solved Object Generator as Particles

Hi,

I'd like to create Python Generator with point cloud. And make it possible to render it as particles using "RS Object" -> "Particles".
Similar to Emitter and Matrix object.

"Particles" tab of "RS Object" is optional, and not appears everythere.
Are there any options to make it possible?

Hi,

sorry, the display of this tab is hardcoded an only available for a couple of builtin objects.

What you can do is have a Matrix object in object mode that point to your generator, the rs tag being applied to the matrix object.

You can also create that setup inside your generator. Below, i am using a cube but that could be your PointObject instead.

Keep in mind that python is slow, using it for point cloud or anything related to particles might be super slow.

from typing import Optional
import c4d

doc: c4d.documents.BaseDocument # The document evaluating this python generator
op: c4d.BaseObject # The python generator
hh: Optional["PyCapsule"] # A HierarchyHelp object, only defined when main is executed

def main() -> c4d.BaseObject:
.
    cube =  c4d.BaseObject(c4d.Ocube)
    parent = c4d.BaseObject(c4d.Onull)
    cube.InsertUnder(parent)
    matrix = c4d.BaseObject(c4d.Omgmatrix)
    matrix.InsertUnder(parent)
    matrix[c4d.ID_MG_MOTIONGENERATOR_MODE] = c4d.ID_MG_MOTIONGENERATOR_MODE_OBJECT
    matrix[c4d.MG_OBJECT_LINK] = cube
    matrix[c4d.MG_POLY_MODE_] = c4d.MG_POLY_MODE_VERTEX
    rsTag = matrix.MakeTag(1036222)
    rsTag[c4d.REDSHIFT_OBJECT_PARTICLE_MODE] = 2

    
    
    return parent

Cheers,
Manuel

MAXON SDK Specialist

MAXON Registered Developer

Hi,

sorry, the display of this tab is hardcoded an only available for a couple of builtin objects.

What you can do is have a Matrix object in object mode that point to your generator, the rs tag being applied to the matrix object.

You can also create that setup inside your generator. Below, i am using a cube but that could be your PointObject instead.

Keep in mind that python is slow, using it for point cloud or anything related to particles might be super slow.

from typing import Optional
import c4d

doc: c4d.documents.BaseDocument # The document evaluating this python generator
op: c4d.BaseObject # The python generator
hh: Optional["PyCapsule"] # A HierarchyHelp object, only defined when main is executed

def main() -> c4d.BaseObject:
.
    cube =  c4d.BaseObject(c4d.Ocube)
    parent = c4d.BaseObject(c4d.Onull)
    cube.InsertUnder(parent)
    matrix = c4d.BaseObject(c4d.Omgmatrix)
    matrix.InsertUnder(parent)
    matrix[c4d.ID_MG_MOTIONGENERATOR_MODE] = c4d.ID_MG_MOTIONGENERATOR_MODE_OBJECT
    matrix[c4d.MG_OBJECT_LINK] = cube
    matrix[c4d.MG_POLY_MODE_] = c4d.MG_POLY_MODE_VERTEX
    rsTag = matrix.MakeTag(1036222)
    rsTag[c4d.REDSHIFT_OBJECT_PARTICLE_MODE] = 2

    
    
    return parent

Cheers,
Manuel

MAXON SDK Specialist

MAXON Registered Developer