fieldlayer with variable tag
-
hi there,
I'm trying to achieve the following:
A python generator that creates an object with a vertex map (A). vertex map (A) is then inserted in a second vertex map (B) to be able to blur (A) with the mode 'average'. (If there is another way to blur a vertex map directly in (A) this would be great, too) You can see my test-setup without the python generator in the screenshot and it works so far.Now with python I have to create fieldlayers with the correct type to make it work. But it looks like the Variable Tag is missing in the list of types. I hope it's not a limitation of of the api.
My test-file is attached. Here is the code of the generator:
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: null = c4d.BaseObject( c4d.Onull ) circle = c4d.BaseObject( c4d.Osplinecircle ) circle[c4d.PRIM_CIRCLE_RADIUS] = 150 cube = c4d.BaseObject( c4d.Ocube ) cube[c4d.PRIM_CUBE_SUBX] = cube[c4d.PRIM_CUBE_SUBY] = cube[c4d.PRIM_CUBE_SUBZ] = 40 vertex_tag = cube.MakeTag( c4d.Tvertexmap ) vertex_tag[c4d.ID_TAGFIELD_ENABLE] = 1 fields = c4d.FieldList() fields.Flush() f_layer_1 = c4d.modules.mograph.FieldLayer( c4d.FLspline ) f_layer_1.SetLinkedObject( circle ) f_layer_1[1009] = 1 # distance mode = radius f_layer_1[1003] = 50 # radius f_layer_1[1005007] = 99 # inner offset fields.InsertLayer( f_layer_1 ) vertex_tag[c4d.ID_TAGFIELDS] = fields displacer = c4d.BaseObject( c4d.Odisplacer ) shader = c4d.BaseShader( c4d.Xcolor ) displacer.InsertShader( shader ) displacer[c4d.ID_MG_SHADER_SHADER] = shader fields_displace = c4d.FieldList() fields_displace.Flush() f_layer_2 = c4d.modules.mograph.FieldLayer( c4d.FLpolygonobject ) # should be type variable tag f_layer_2.SetLinkedObject( vertex_tag ) fields_displace.InsertLayer( f_layer_2 ) displacer[c4d.FIELDS] = fields_displace circle.InsertUnderLast( null ) cube.InsertUnderLast( null ) displacer.InsertUnder( cube ) return null
-
found the solution ... the corresponding type is called: FLweight