How do I prevent the cinema from running my plugin if I don't start rendering at frame 0?
Posts made by pyr
RE: Combine UV and worldposition while shader rendering
Ok - than i need to use fields for 3d gradients and other scene based stuff. Thank you for the explantation.
Combine UV and worldposition while shader rendering
I have a shader with a UV based texture and a 3d gradient in it the shader effector works as espected but i have no idea how to relicate this behavior with a python effector / python plugin
I builded a simple example scene to show what i need to do: uvSpaces.c4d
The shader effector works as desired but i need this behavior into one of my plugins.
The Python effector use the same technique as my plugin does and I also add a toggle for uv and worldspace
RE: bc lost stored mesh
After taking a deep dive into the documentation again i figure out that im thinking way to complicated. I use the Cache provided by cinema and write a custom check around it. This avoid using a cached mesh in a baseContainer and also removing a cinema4d breaking memoryleak in my plugin i just found.
So thank you.
RE: bc lost stored mesh
This is the GVO from another plugin which works flawless. The only difference is that i didn't use an input object.
def GetVirtualObjects(self, op, hh): if not op[c4d.ID_BASEOBJECT_GENERATOR_FLAG]: return None if op[res.GRIDDER_OUTPUT] == 0: if self.CacheCheck(op, op.GetDocument()) is True: preReturn = op[res.GRIDDER_CACHE].GetData(1005) return preReturn return self.Gridder(op) return None
meshCache = op.GetClone() bc = c4d.BaseContainer() bc.SetData(1001, self.HelperGetOptions(op)) bc.SetData(1002, self.CacheShader(op, doc)) bc.SetData(1003, self.CacheField(op, doc)) if doc != None: bc.SetData(1004, doc.GetTime().GetFrame(doc.GetFps())) bc.SetData(1005, meshCache) op[res.GRIDDER_CACHE] = bc c4d.StatusClear()
On the other hand: I have no idea how to serialize a polygon object with uvs, vertex maps and phongtag. Also seems HyperFile a little bit over the top to store something temporary. MemoryFileStruct() could work but I need to store the byteseq as well...
GetAndCheckHierarchyClone works but it has the disadvantage of refreshing during viewport changes, so I need to use my own dirtycheck.
I think I am doing something fundamental wrong there
bc lost stored mesh
my generator plugin takes the first mesh child object and modify it. than it stores the current values into a bc and return the mesh to the scene unfortunally i can't get acces to my cache mesh via bc via
clone = op[res.REDUCER_CACHE].GetData(1005)
full gvo :
def GetVirtualObjects(self, op, hh): """ :param op: :param hh: :return:mesh """ """ setup """ if not op[c4d.ID_BASEOBJECT_GENERATOR_FLAG]: return None doc = op.GetDocument() srcObj = op.GetDown() if not srcObj: return None while srcObj: mesh = self.ModelCurrentStateToOBject(doc, [srcObj]) if isinstance(mesh,c4d.PolygonObject): op.GetAndCheckHierarchyClone(hh, srcObj, c4d.HIERARCHYCLONEFLAGS_0, True) break srcObj = srcObj.GetNext() mesh = self.HelperFieldToVertexmap(op,mesh) firstFieldCache = sum(self.HelperGetVertexMapData(mesh)) clone = op[res.REDUCER_CACHE].GetData(1005) if clone and self.CacheCheck(op,firstFieldCache): return clone mesh,avgLvlDistList = self.Reducer(doc, op, mesh) """ cache """ bc = c4d.BaseContainer() bc.SetData(1001, self.HelperGetOptions(op)) bc.SetData(1002, firstFieldCache) if doc != None: bc.SetData(1004, doc.GetTime().GetFrame(doc.GetFps())) cMesh = mesh.GetClone() bc.SetData(1005, cMesh) op[res.REDUCER_CACHE] = bc return mesh
Splinefield radius reset to 0 when using takes
What i do:
- Create a plain effector
- Create a spline
- Use spline as falloff ( Curve / Radius )
- Set a radius
- Create a Take
- Set another radius
- Switch takes.
Version affected : 20 & 21 can't test 22 because i didn't have an developer version and no active subscription.
RE: Avoid creating new field object as child from plugin
so it might be an easier solution to just iterate over all childs from my generator plugin and check for the first BaseMesh.
Avoid creating new field object as child from plugin
i got a plugin with a field input. if i create a new field object, cinema automatic create its as a child. is there a way to force new field objects spawns nexts to my plugin not under ?