Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
I have several object plugins and they all have the same problem - my custom caching functions work as expected until the document is saved and reopened. In that case the generator object returns an empty object. is there any kind of event I could use to force an update?
I got a setup with a stationary camera. i need to keep the object centered in my view and maximize its size but i can't change the rotation / position of my camera.
what i have so far is the following:
i calculate the center of the objekt and change the offset accordingly to center the object. now if i want to zoom in my offset calculations are wrong again.
fovProblem.c4d
edit:
can someone please move the thread into the right subforum?
here is a script i use to color polygon groups. unfortunately a bit slow
import c4d from c4d import gui import random def main(): random.seed(666) c4d.CallCommand(12139) # point mode selection = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_NONE) for s in selection: cnt = s.GetPointCount() tag = c4d.VariableTag(c4d.Tvertexcolor, cnt) data = tag.GetDataAddressW() bs = s.GetPointS() done = [] for i in range(cnt): if i in done: continue r = random.random() g = random.random() b = random.random() c = c4d.Vector4d(r,g,b,1) bs.DeselectAll() bs.Select(i) c4d.CallCommand(12557) sel = bs.GetAll(cnt) for index, selected in enumerate(sel): if not selected: continue done.append(index) c4d.VertexColorTag.SetColor(data, None, None, index, c) done = list(set(done)) s.InsertTag(tag) # Execute main() if __name__=='__main__': main()
forget about it. i removed the c4d.OBJECT_INPUT flag during development and forgot to add it back.
@m_magalhaes said in HOW TO REMOVE GENERATOR CHILDS WHEN CONVERTING VIA "C":
Something you can do is touching the objects either with a dependency list or directly.
Ah - i thought that touch only works with GVO. Never tried it to be honest. This solve at least the visibilty problem.
Hey,
i have built a spline gernerator that modifies a spline, when i convert the object i get my modified spline but also the hirachie remains. however i only need the new spline object.
Since GetContour() unfortunately doesn't support HirachyHelper I don't know how to hide the original objects and how to prevent the original splines from being present after the conversion.
https://gumroad.com/l/spliner
<3<3<3<3
The script change the compression method to zip not to Zips or what i expected: RLE because rle was the given value.
I need to change my exr compression to one scanline at a time but beside using a c4d default document is there any other way to change it directly in a script?
R23 still has the same Error
How do I prevent the cinema from running my plugin if I don't start rendering at frame 0?
Ok - than i need to use fields for 3d gradients and other scene based stuff. Thank you for the explantation.
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
Shader Effector: Python Effector:
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.
Ah sorry.
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)[0]) 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
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])[0] 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
What i do:
Version affected : 20 & 21 can't test 22 because i didn't have an developer version and no active subscription.
okay
so it might be an easier solution to just iterate over all childs from my generator plugin and check for the first BaseMesh.
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 ?