• GetSplinePoint REVERSE

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    803 Views
    Caleidos4DC
    Thanks ferdinand I will treasure your help. Thank you very much!
  • Material and Shader Questions

    Cinema 4D SDK python s26
    3
    0 Votes
    3 Posts
    433 Views
    gheyretG
    @m_adam OK~ Thank you so much!
  • Why does "Symbols Parser" not work?

    Cinema 4D SDK python
    3
    3
    0 Votes
    3 Posts
    597 Views
    L
    Great!!! It runs. You are right. Thank you so much! I think your answer is worth being written in the API document to make the workflow more clear.
  • 0 Votes
    3 Posts
    682 Views
    chuanzhenC
    @ferdinand Thanks for your help!
  • 0 Votes
    6 Posts
    1k Views
    DunhouD
    I find a way to read aovs and render container , if I had some times I will post a create Read Octane Post from typing import Optional import c4d SET_RENDERAOV_IN_CNT=3700 SET_RENDERAOV_INPUT_0=3740 RNDAOV_TYPE=995 RNDAOV_ENABLED=994 doc: c4d.documents.BaseDocument # The active document op: Optional[c4d.BaseObject] # The active object, None if unselected c4d.CallCommand(13957) #clear console def main() -> None: rdata = doc.GetActiveRenderData() vpost = rdata.GetFirstVideoPost() OctaneRender_ID = 1029525 octVp=None # rdata[c4d.RDATA_RENDERENGINE] = OctaneRender_ID while vpost: print(vpost) if vpost.GetName() == "Octane Renderer": octVp=vpost vpost = vpost.GetNext() if octVp: aovCnt = octVp[SET_RENDERAOV_IN_CNT] print ("--- OCTANERENDER FOUND ---") print(octVp) print ("Buffer:",octVp[1010]) print ("Color space:",octVp[1028]) print ("AOV count:",aovCnt) for i in range(0,aovCnt): aov = octVp[SET_RENDERAOV_INPUT_0+i] enabled = aov[RNDAOV_ENABLED] type = aov[RNDAOV_TYPE] print ("AOV1:",aov," type:",type," enabled:", enabled) if type==185: # cryptomatte print (" crypto_type:",aov[1821]) if type==255: #z-depth AOV print (" z-depth max:",aov[3392]," env.depth:",aov[3397]) if __name__ == '__main__': main()
  • "Render Marked Takes" Command via Python?

    General Talk python s26
    3
    0 Votes
    3 Posts
    735 Views
    delizadeD
    Hi Manuel, Thank you for your help.
  • 0 Votes
    5 Posts
    1k Views
    jochemdkJ
    Done, didn't know I could do it myself :}
  • Copy info from one Object to other Object

    Cinema 4D SDK python s22
    5
    0 Votes
    5 Posts
    1k Views
    John_DoJ
    @Manuel Thanks ! Still here in 2024.5.1
  • Cinema 4D 2023 None bug

    Cinema 4D SDK sdk python windows
    3
    2
    0 Votes
    3 Posts
    600 Views
    DunhouD
    @ferdinand I Check with my home PC in R 2023, It works fine , And for some reason , It report a none last time I am pretty sure I have not insert a layer field in fieldlist ( I just miniest the scene for test code ) , But when I resart C4D today this none warning just gone Maybe It is just a oolong events I make some thing I don't know . Sorry for that . And Thanks for the TIPS , next post I will take a more spesific report cheers~
  • Force VertexMap display

    Cinema 4D SDK python
    18
    0 Votes
    18 Posts
    3k Views
    ymoonY
    @ferdinand, Is it possible to VertexColor, WeightMap(character rig) in the same way? Some games use VertexColor, so marking can always be useful. I tried to convert your code to VertexColor, but I lack knowledge. Please help us.
  • 0 Votes
    8 Posts
    2k Views
    DunhouD
    @ferdinand Thanks for the detailed explain I think DescriptionCustomGui is the best way to solve this for now . With learning furthur , maybe I will try a C++ version , but for me it's not time . Anyway , It is helpful for this techniclly explain and the example
  • Render Settings change Save state

    Cinema 4D SDK python s22
    8
    1
    0 Votes
    8 Posts
    1k Views
    chuanzhenC
    @ferdinand Thanks you for your help!
  • 0 Votes
    7 Posts
    1k Views
    DunhouD
    @ferdinand Thnaks for your help, I think it is enough for this specific toppic . It work as espected
  • how to Scroll UserArea

    Cinema 4D SDK s22 python
    7
    1
    0 Votes
    7 Posts
    2k Views
    chuanzhenC
    @m_adam Thanks for your help,great work!
  • How to detect click on a item in InExclude list?

    Cinema 4D SDK python
    10
    0 Votes
    10 Posts
    2k Views
    M
    Hi with the 2023.1 release, the method InExcludeData.GetData have been added to the Python SDK. Cheers, Maxime.
  • 0 Votes
    11 Posts
    2k Views
    R
    Since I know exactly what methods access/check/change the self.xxxx variables, it is a risk I'm willing to take As for the solution, I removed the c4d.EventAdd() and at the GetContour method I was simply calling the function that was creating the spline. Now I perform a few checks for "dirtyness" and only after they show that something is dirty, I call the function to produce the spline.
  • How do I get the status of redshift AOV mode?

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    327 Views
    ManuelM
    Hi, Please mark your thread as a question using the forum tools. Redshift is a VideoPostData plugin. You cannot access the parameter directly in the renderdata. This is just a guess of what you are trying to do. Instead, you must find the VideoPostData that contain all Redshift parameters. from typing import Optional import c4d import redshift doc: c4d.documents.BaseDocument # The active document op: Optional[c4d.BaseObject] # The active object, None if unselected def main() -> None: renderdata = doc.GetActiveRenderData() vprs = redshift.FindAddVideoPost(renderdata, redshift.VPrsrenderer) if vprs is None: raise ValueError("Cannot find the redshift VideoPostData") print (vprs[c4d.REDSHIFT_RENDERER_AOV_GLOBAL_MODE]) if __name__ == '__main__': main() There is this thread where you will find a script to print all the AOVs Cheers, Manuel
  • 0 Votes
    3 Posts
    577 Views
    ferdinandF
    Hello @lingza, Thank you for reaching out to us. There are in principle two ways how you can do this: Do not use an InExcludeData and make the dependencies of your deformer direct children of the deformer. A deformer will automatically be invoked when either the direct parent or children are modified. This is IMHO a much simpler solution, but you are of course restricted in where you can put these dependencies in a scene, as they must be children of the deformer. When you want to go with InExcludeData, you must overwrite ObjectData.CheckDirty to manually flag the deformer as dirty when necessary. You iterate over all objects in the InExcludeData and based on their dirty count decide if the deformer is dirty or not. Find a draft for the method at the end of my posting. Cheers, Ferdinand The result: [image: 1662476641343-modifierdirty.gif] The code: def CheckDirty(self, op: c4d.BaseObject, doc: c4d.documents.BaseDocument) -> None: """Called by Cinema 4D to let a modifier flag itself as dirty. Args: op: The object representing the modifier hook. doc: The document containing the modifier. """ # When we want to track dependencies we must keep a cache for what we consider to be the # last no-dirty state of things. This could be done in many ways, I have chosen here a # dict of (bytes, int) tuples. # # The general idea is to store the last known dirty state data for each item in the # InExcludeData as such: # # { Object_A: 193, Object_B: 176, Object_C: 25, ...} # # But BaseList2d instances itself are not hashable, i.e., cannot be keys in a dict, and # doing something like `myDict[id(someObject)] = someValue` would be a really bad idea, # as objects are managed in the backend by Cinema 4D and can be reallocated all the time, # so id(myBaseList2d) is not a safe way to identify objects. Instead we are using # C4DAtom.FindUniqueID to get the unique MAXON_CREATOR_ID marker of each item and then # use that marker to store the dirty flags. # The dirty cache data structure attached to the plugin class and the InExcludeData parameter # in question. self._linklistDirtyCache: dict[bytes: int] data: c4d.InExcludeData = op[c4d.ID_LINKLIST] if not isinstance(data, c4d.InExcludeData): return # Now we iterate over all items in the InExcludeData to see if their dirty state has changed. isDirty: bool = False for i in range(data.GetObjectCount()): node: c4d.BaseList2D = data.ObjectFromIndex(doc, i) if not isinstance(node, c4d.BaseList2D): continue # Get the MAXON_CREATOR_ID unique ID of this node. mem: memoryview = node.FindUniqueID(c4d.MAXON_CREATOR_ID) if not isinstance(mem, memoryview): continue uuid: bytes = bytes(mem) # Get the current and cached dirty state of that item. currentDirtyCount: int = node.GetDirty(c4d.DIRTYFLAGS_DATA | c4d.DIRTYFLAGS_MATRIX) cachedDirtyCount: typing.Optional[int] = self._linklistDirtyCache.get(uuid, None) # When there is either no cache or the cache differs from the current value, we update # our cache and set isDirty to True. if (currentDirtyCount is None) or (cachedDirtyCount != currentDirtyCount): isDirty = True self._linklistDirtyCache[uuid] = currentDirtyCount # When isDirty is True, we flag ourselves as dirty, which will cause ModifyObject to be called. if isDirty: op.SetDirty(c4d.DIRTYFLAGS_DATA) print (f"Modifier has been set dependency dirty: {self._linklistDirtyCache.values()}")
  • some problem with CUSTOMGUI_BITMAPBUTTON

    Cinema 4D SDK s26 python sdk
    3
    2
    0 Votes
    3 Posts
    569 Views
    M
    thank you very much! It's help me a lot! sorry about the multiple topics, I'll take them apart next time
  • 0 Votes
    2 Posts
    414 Views
    M
    Hi @pyxelrigger sadly since S26 this is not anymore possible, previously it was saved within the world container like so wc = c4d.GetWorldContainerInstance() wc[c4d.WPREF_FILEPATH_ALL] = r"C:\Users\m_adam\Documents\MAXON\Build\2023.000_381745" This is still used by c4d.storage.LoadDialog and c4d.storage.SaveDialog functions, but internally we don't use anymore these functions. I've open a ticket internally as this is a regression. Cheers, Maxine.