Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login
    1. Home
    2. mocoloco
    • Profile
    • Following 0
    • Followers 0
    • Topics 14
    • Posts 62
    • Best 3
    • Controversial 0
    • Groups 0

    mocoloco

    @mocoloco

    3
    Reputation
    13
    Profile views
    62
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website www.mocoloco-lab.com Location Geneva, Switzerland Age 51

    mocoloco Unfollow Follow

    Best posts made by mocoloco

    • RE: Some basic questions on BaseContainer

      Hi @orestiskon,

      From what I learnt recently, if you have more than one data to store, you can create a sub container of the base container identified by the pluginID.

      I can't remember where I read that... just be careful I'm not an advanced C4D developer 😉

      In a class for a BaseTag I use this like that,

              self.bcDATAS = c4d.BaseContainer()
              self.bcDATAS[ myData ] = "A string for example"
              # Be sure to use a unique ID obtained at https://developers.maxon.net/forum/pid
              myPLUGIN_ID = 0123456789 
      
              # Get the Document Settings BaseContainer
              self.bcDoc = doc.GetDocumentData( c4d.DOCUMENTSETTINGS_DOCUMENT )
              self.bcDoc[ myPLUGIN_ID ] = self.bcDATAS # Store plugin container inside the document container
      
              # Save the updated Document BC
              op.SetData( self.bcDoc )
              
              # To retrieve a data
              print ( op.GetData()[ myPLUGIN_ID ][ myData ] )
      
      

      Cheers,

      Christophe

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • RE: Some basic questions on BaseContainer

      @orestiskon, self is used because the example is an extract of a class. In my case, those variables are defined in the def __init__ (self):, and belongs to the class object. They are not globals. Have a look there, https://docs.python.org/3/tutorial/classes.html you will understand it with a much better explanation than mine.

      If you plan to do not use that inside a class, you can get rid of self of course. Just be careful of doc and op used here below as they are arguments of def Execute(self, tag, doc, op, bt, priority, flags): used in my BaseTag plugin.

      Knowing this, I assume you can easily transpose this to your purpose as the following example won't work as it is 😉

      bcDATAS = c4d.BaseContainer()
      bcDATAS[ myData ] = "A string for example"
      # Be sure to use a unique ID obtained at https://developers.maxon.net/forum/pid
      myPLUGIN_ID = 0123456789 
      
      # Get the Document Settings BaseContainer
      bcDoc = doc.GetDocumentData( c4d.DOCUMENTSETTINGS_DOCUMENT )
      bcDoc[ myPLUGIN_ID ] = bcDATAS # Store plugin container inside the document container
      
      # Save the updated Document BC
      op.SetData( bcDoc )
              
      # To retrieve a data
      print ( op.GetData()[ myPLUGIN_ID ][ myData ] )
      
      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • RE: Getting the proper formatting/display on .RES

      I noticed by having a look on other .res files that there is a STATICTEXT { JOINEND; } that exists and can be applied on LAYERGROUP as well as STATICTEXT { NEWLINE; } but I didn't got the use of the last one as that does not create the "\r" or "\r\n" it should.

      Didn't found any informations in the SDK (C++ nor Python) about JOINEND and JOINENDSCALE... those tags looks like to be undocumented.

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco

    Latest posts made by mocoloco

    • RE: Can't get a correct rendering in picture viewer of the current scene running my TAG plugin while it works in viewport

      Hi, thanks for your reply.

      I can't disclose the whole plugin as it is our know how, but anyway I can clarify the goal of it and how it is done.

      So both plugin have the same architecture and are TagData. Both TAG are only use to manipulate Tx, Ty, Tz and Rx, Ry, Rz of some of the objects hierarchy underneath the root node which hold the TagData plugin.

      Those new values update the position or rotation of an objects through Message() when a slider is moved, and Execute() methods to update the whole hierarchy relaying on those sliders assigned to Tx, Ty, Tz, Rx, Ry, Rz.

      The question here is: if I have to consolidate something somewhere to get the rendering as it is in the viewport, what do I have to implement and were? Does that need to be in the Message() method or in Execute()?

      Could you please give me some insight on this, that would be really helpful.

      Thanks!
      Christophe

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • RE: Can't get a correct rendering in picture viewer of the current scene running my TAG plugin while it works in viewport

      Hi,

      @spedler, I had a look on my plugin and I do not find any CopyTo() function related to the TagData object, it's a RegisteredTagPlugin, and I use it to manipulate sibling objects of the root level which have the TAG plugin. From what I understood, all is saved in the BaseDocument() and reloaded when the scene is loaded - which is the case.
      So, I do not understand where the CopyTo() should take place and with which object? I do understand the principle - if that the one should applied here, but really do not know how to set that up here in a TAG Plugin.

      Thanks

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • RE: Can't get a correct rendering in picture viewer of the current scene running my TAG plugin while it works in viewport

      Hello @spedler, thanks for the lead, I'm going to check this and see if it change something or not.

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • RE: Can't get a correct rendering in picture viewer of the current scene running my TAG plugin while it works in viewport

      Hello there,

      Here few more visuals to explain what's going on. I honestly do not know how what I'm getting in the viewport does not render as it is... there is something I really do not understand.

      Screenshot 2023-12-04 at 09.23.33.png

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • Can't get a correct rendering in picture viewer of the current scene running my TAG plugin while it works in viewport

      Hi there,

      There is something that it is hard to understand at my level of knowledge. I have two plugin that are perfectly working in C4D, both of them are TAG plugins attached to the root of a hierarchy and somehow, what I see in the viewport can't be rendered in the Picture Viewer correctly. Some of the object retains other orientation or do not take into account the animation while they are by pressing play in the 3D environment.

      Here few pictures to illustrate the problem,

      1. Viewport capture of the object with the object in yellow that does not render correctly.
        Screenshot 2023-12-01 at 22.42.32.png
      2. The same frame in Render View mode and Interactive Render mode which are also correctly rendered
        Screenshot 2023-12-01 at 22.42.41.png
        Screenshot 2023-12-01 at 22.42.55.png
      3. The render of the same frame sent to the Picture Viewer, were the object is taking a bad orientation on XYZ axis.
        Screenshot 2023-12-01 at 22.43.27.png

      I'm guessing what could cause this kind of issue? Could that be a priority problem or a missing Matrix calculation that occurs in def Execute() of the plugin when rendered normally? Or could that be related to something else I completely missing or skipped?
      On the second plugin the Camera which is linked to the hierarchy seems locked to the current frame I'm in the timeline when I'm starting the render. Like if the animation applied to its parent object is not took into account and so the camera remains still.

      All your light and ideas are more than welcome, I'm completely stuck on this.
      Cheers,

      Christophe

      posted in Cinema 4D SDK 2023 2024 macos python
      mocolocoM
      mocoloco
    • RE: Can REAL MIN / MAX value be changed on Init?

      Hi there,
      Was the issue fixed on R2023 or R2024?

      Thanks,
      Christophe

      posted in Bugs
      mocolocoM
      mocoloco
    • RE: Keyframing the source file on an ImageTexture shader

      Hi,

      A simple addition on CTrack and DescId as I was also faced to this a time ago. You can consult the @ferdinand's explanations and exemples on CTrack to the following post :

      https://developers.maxon.net/forum/topic/14315/solved-how-to-setup-a-ctrack-on-tag-plugin-ui-slider-with-extended-details/8

      Cheers,
      Christophe

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • RE: Struggling on SetParameter for OLight

      Hi @m_adam,

      Thanks a lot for the flags, it does work as expected now.
      Are c4d.DESCFLAGS_GET_NONE and c4d.DESCFLAGS_GET_0 similars?

      Cheers,
      Christophe.

      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • RE: Struggling on SetParameter for OLight

      Little addition after looking for a solution and reading more on OLight, it seems that the correct data type is c4d.DTYPE_VECTOR instead of c4d.DTYPE.COLOR. But even with this I can't reach the value.

       # TAG Execute() method
      def Execute(self, tag, doc, op, bt, priority, flags):
          self.tagData = tag.GetDataInstance()
          sim_color = c4d.Vector(0) # For debug purpose, set a black color value
      
          if op.GetType() == c4d.Olight:
              # For debug purpose  
              print( op.GetParameter( c4d.DescID(c4d.DescLevel(c4d.LIGHT_COLOR, c4d.DTYPE_VECTOR, 0)), c4d.DESCFLAGS_GET_PARAM_GET ) )
      
              op.SetParameter( c4d.DescID(c4d.DescLevel(c4d.LIGHT_COLOR, c4d.DTYPE_VECTOR, 0)), sim_color, c4d.DESCFLAGS_SET_USERINTERACTION )
          
              return c4d.EXECUTIONRESULT_OK
      
      posted in Cinema 4D SDK
      mocolocoM
      mocoloco
    • Struggling on SetParameter for OLight

      Hello there!

      I'm starting a new TAG plugin development and I would like to affect OLight parameter, i.e. c4d.LIGHT_COLOR, but my DescId does not reach its target.

      All this is happening in dataTag.Execute.

      Here the code, and the GetParameter returns only None, which means there is something wrong...

       # TAG Execute() method
      def Execute(self, tag, doc, op, bt, priority, flags):
          self.tagData = tag.GetDataInstance()
          sim_color = c4d.Vector(0) # For debug purpose, set a black color value
      
          if op.GetType() == c4d.Olight:
              # For debug purpose  
              print( op.GetParameter( c4d.DescID(c4d.DescLevel(c4d.LIGHT_COLOR, c4d.DTYPE_COLOR, 0)), c4d.DESCFLAGS_GET_PARAM_GET ) )
      
              op.SetParameter( c4d.DescID(c4d.DescLevel(c4d.LIGHT_COLOR, c4d.DTYPE_COLOR, 0)), sim_color, c4d.DESCFLAGS_SET_USERINTERACTION )
          
              return c4d.EXECUTIONRESULT_OK
      

      I tried different flags for SetParameter, but based on @ferdinand explanation on CTrack, it seems that c4d.DESCFLAGS_SET_USERINTERACTION is the good one.

      If someone can light me up on this, that would be awesome.

      Cheers,
      Christophe

      posted in Cinema 4D SDK python s26
      mocolocoM
      mocoloco