• Setting render engine to Redshift

    s26 c++
    3
    0 Votes
    3 Posts
    637 Views
    S
    Hi Ferdinand, That's great, I'll take a look at that file and see what happens with that. Many thanks once more for your help. (Later) Got, it, works perfectly, thank you very much! Cheers, Steve
  • Cinema 4D 2023 None bug

    sdk python windows
    3
    2
    0 Votes
    3 Posts
    628 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~
  • Remove node from Redshift node graph

    s26 c++
    3
    0 Votes
    3 Posts
    535 Views
    S
    Ah...so simple in the end! Navigating this maze of interdependent classes used in the node system is not easy, that's my excuse Many thanks for this, it solves a very tricky problem I was having. Cheers, Steve
  • Render Settings change Save state

    python s22
    8
    1
    0 Votes
    8 Posts
    1k Views
    chuanzhenC
    @ferdinand Thanks you for your help!
  • how to Scroll UserArea

    s22 python
    7
    1
    0 Votes
    7 Posts
    2k Views
    chuanzhenC
    @m_adam Thanks for your help,great work!
  • Removing an object from a PointerArray without deleting it

    c++
    5
    0 Votes
    5 Posts
    939 Views
    fwilleke80F
    Hi Ferdinand, thank you! In deed, that looks pretty simple. Wonder why I couldn't get it to compile... I'll test this and report back in case it doesn't work. Since I guess you found it in active code, I'll mark this thread as solved for now. thanks again! Cheers, Frank
  • 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
  • Sometimes, IRR stops working when my plugin is placed on a scene.

    python
    11
    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.
  • 0 Votes
    3 Posts
    614 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()}")
  • Setting bitmap in Redshift dome light

    s26 c++ windows
    10
    0 Votes
    10 Posts
    2k Views
    ferdinandF
    Hey @spedler, I am glad that this solved your problem. Regarding putting this in the docs or SDK: I have created a task for doing this, but there is other stuff in front of the queue, so it might take some time before I find the time to do so. Cheers, Ferdinand
  • How do I get the status of redshift AOV mode?

    python
    2
    0 Votes
    2 Posts
    346 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
  • some problem with CUSTOMGUI_BITMAPBUTTON

    s26 python sdk
    3
    2
    0 Votes
    3 Posts
    612 Views
    M
    thank you very much! It's help me a lot! sorry about the multiple topics, I'll take them apart next time
  • Attach Export Dialog

    python
    5
    0 Votes
    5 Posts
    864 Views
    J
    @m_adam Thank you very much! This is what I was looking for.
  • 0 Votes
    2 Posts
    446 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.
  • Developing for MacOS

    c++ macos
    6
    0 Votes
    6 Posts
    1k Views
    S
    @m_adam Thanks very much for your comments. You asked which parts of the manual page weren't clear. It's more that it's incomplete, in that it doesn't tell you how to get a bundle ID, app password or provider ID. Also, I don't think the statement that adding a timestamp is optional if you enable the hardended runtime is correct - from what I can see, you must provide a timestamp even though you enable the hardended runtime. The other thing is that invariably at some point the process is going to fail and there's no mention of what to do when it does. It's extremely frustrating when the notarization fails and you have to figure out why. Apart from that, the page is actually very good - just needs a bit more detail (IMO). Steve
  • Updating my r20 C++ plugins to r21 and up

    9
    0 Votes
    9 Posts
    2k Views
    R
    @kbar, thank SO MUCH. I will look into it.
  • Remove Shortcut failed

    3
    1
    0 Votes
    3 Posts
    455 Views
    DunhouD
    @ferdinand Thank you for detailed explain . It's great to add a shortcut container document update and small examples , actually , more examples on sdk or Github is really helpful. After reading I try to re-write it and add some functions like add shortcut or check plugin's shortcut list, It's all worked as expected . Shortcut BaseContainer explain is that great to move on . By the way , from those examples , I learned and try to keep code style as easy to read and repair like yours at the same time . So much appreciated.
  • Changing description of material nodes dynamically

    c++
    6
    0 Votes
    6 Posts
    1k Views
    ManuelM
    @deyan said in Changing description of material nodes dynamically: is there an alternative for earlier SDK versions? In our example, you have the files nodessystem_observer.h/cpp this shows how to create a ticket system. This system is based on observable that you can use, those observables are accessible in the GraphModelInterface or the NodeSystemManagerInterface. ObservableTransactionStarted ObservableTransactionCommitted ObservableTransactionRolledBack You have another example in our manual The problem with observable is that you need to be sure that your function is registered or unregistered the right way/time. You need a proper system to handle those "tickets". For now, you only have this "basic system". Cheers, Manuel
  • Working with UserData Python

    python
    7
    3
    0 Votes
    7 Posts
    1k Views
    E
    Thank you once again I marked as solved
  • GeDialog Failing To Open

    c++ s26 sdk
    6
    0 Votes
    6 Posts
    1k Views
    J
    Thanks for the response. This seems to have solved the problem. John Terenece