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
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. a_block
    • Profile
    • Following 0
    • Followers 3
    • Topics 31
    • Posts 329
    • Best 113
    • Controversial 0
    • Groups 0

    Andreas Block

    @a_block

    167
    Reputation
    703
    Profile views
    329
    Posts
    3
    Followers
    0
    Following
    Joined Last Online
    Location Hannover, Germany

    a_block Unfollow Follow

    Best posts made by a_block

    • RE: Good Bye and Thanks for the Fish

      Thanks to everybody in this thread for all your kind words.

      @C4DS said in Good Bye and Thanks for the Fish:

      As mentioned earlier, this place won't be the same without you.

      You may overestimate my contribution. Silently watching from the side line, my feeling is, Riccardo, Sebastian, Maxime and Manuel, though being handicapped by a little loss of man power, not only managed to continue to do a great job in here, but even managed to further improve. Just let the dust of change settle a bit and they'll excel even more.

      @C4DS said in Good Bye and Thanks for the Fish:

      And with the recent unraveling of the plot, this "ending of your novel" has sure taken a new twist.

      I'm not quite sure where you are heading and which plot recently unraveled. But please believe me, my departure was not so much related to Maxon and certainly not connected to any announcements on Maxon's strategy of the recent past. I left a group of friends behind, mostly for private and to a certain extent selfish reasons, which I won't discuss in public. Yet, please, try not to read between the lines and do not interpret my silence against Maxon or the SDK Team. I really enjoyed being part of the ride. Having had the chance to meet all of you in here was really great. It's just sometimes you need to stop eating, when it tastes best. I'm pretty sure Forest Gump also said some fitting words, I just can't remember...

      Cheers,
      Andreas

      posted in News & Information
      a_blockA
      a_block
    • RE: Simple Box Gui Creation

      Hi,

      thanks for the additional information and setting the tags.

      The BitmapButton needs to be added to the dialog via AddCustomGui().
      For example like so:

              # Prepare a red bitmap for the button.
              w = 50
              h = 50
              bmpRed = c4d.bitmaps.BaseBitmap()
              bmpRed.Init(w, h)
              for y in xrange(w):
                  for x in xrange(h):
                      bmpRed.SetPixel(x, y, 255, 0, 0)
              # BitmapButton configuration
              bcBitmapButton = c4d.BaseContainer()
              bcBitmapButton[c4d.BITMAPBUTTON_BUTTON] = True
      
              # Add a BitmapButton to the dialog.
              # _bitmapButton is a member variable of the dialog class
              buttonId = 2000
              _bitmapButton = self.AddCustomGui(buttonId, c4d.CUSTOMGUI_BITMAPBUTTON, "", c4d.BFH_CENTER|c4d.BFV_CENTER, w, h, bcBitmapButton)
              if _bitmapButton is None:
                  print "Handle this error!"
              # Assign the image to the button.
              # Note: Let it create an internal copy as the created bitmap will be free'd, when scope is left.
              _bitmapButton.SetImage(bmpRed, True)
      

      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: C++ and Python Sections

      Hi Kent,

      thanks for your feedback.

      Actually merging C++ and Python categories was an outcome of our beta phase, where some were of the opinion too many categories would not be desirable. But there's another reason we did so: Our C++ and Python APIs are actually so similar, that many answers hold for both languages.
      And lastly, if it were just for the C++ and Python tags, we probably wouldn't even ask for the tags. It's rather tags about version or API in use, we are interested in most.
      Oh, and by the way, although I have to admit it was less frequent in the old forum, but instead of asking for tags we were asking to post into the right category. Which by the way still happens with just the four we have here.
      Oh, oh... Kent, can you please consider using tags? See About This Forum. Thanks!
      Just kidding. 😉

      But anyway, these are our reasons, maybe others have different ones and agree with yours. Then please, provide us with your arguments and opinions. It's not that we wouldn't care. We have taken notes of all feedback we received so far and will evaluate this hopefully during November. So, it's actually a good time to provide such feedback.

      Maybe we can also address your aversion of "oversized" text. We'll look into providing themes. But we also need to see, what we can actually achieve and maintain in a certain amount of time. After all we think, support work is more important than induldging in web design.
      One thing I can say for sure, though. It's not your age. Because with my age increasing I definitely need larger and larger text...

      Now, for the community aspect. I'm really sorry to hear this. I can only say, no, it was not our intention to kill the community in Plugin Café. Believe me, quite the opposite. I'd be really interested in more opinions and suggestions on this topic.
      Here's how I see it:

      • It's always risky to replace a forum, moving the site. And I'm not sure everybody has already joined us here. We had very good reasons for this move and I really hope, everybody will follow.
      • With us answering in a day or two on most questions, there's often no more reason for the community to contribute. Looking into the old Plugin Café you will find many thready which took days if not weeks to get an answer from the community. So, I guess, we could revive some community aspects by simply postponing our answers, but I'm not sure that's desirable either.

      For example @mp5gosu told us, how much he likes working in this new forum. And we can see him actively discussing and contributing.

      Please, everybody, come in, join this thread and provide us with your feedback. Tell us what you want and need. Kent mentioned some good points here. One especially worries me. Help us make this forum the place you want to be supported in. Help us to make this the place you want to discuss your plugin development related topics in.

      Cheers,
      Andreas

      posted in General Talk
      a_blockA
      a_block
    • RE: Simple Box Gui Creation

      Hi,

      no worries, we'll get you there.

      One recommendation: When doing Python development, have the Cinema 4D Console window open (Menu Script -> Console...). There you will be presented with errors.

      I think, your problem will be, that you try to access op, probably intending to change parameters of the active object. In Script Manager doc and op are global variables predefined for convenience. In a plugin, you have to get these yourself using GetActiveDocument() and GetActiveObject().

      Bye,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • Seasonal Greetings

      Dear fellow developers,

      my seasonal greetings to the entire community.

      But I'd also like to take the chance to say thanks to "our" SDK Team, who served us so well during the entire year. Patiently answering even my most stupid questions, as if they had nothing else to do (which of course they most likely have)...

      So, please, everybody in this community join me in saying:

      Thanks for supporting us so well, Riccardo, Sebastian, Maxime and Manuel!

      Everybody hopefully gets some well deserved days of rest.

      Cheers,
      Andreas

      posted in General Talk
      a_blockA
      a_block
    • RE: Clear LinkBox field

      Hi Andre,

      you can simply use SetLink(), the opposite of GetLink().

      In order to clear a link box, you'd call: self.linkBox.SetLink(None)

      The type you do in your code snippet is a bit unconventional in terms of Cinema 4D's API (not wrong though), but usually we recommend to stay in our API for example with CheckType() or IsInstanceOf(). But in the end, I think, you don't even need the type check, if you simply restrict the types accepted by the link box.
      For example like so:

      bcAcceptedObjects = c4d.BaseContainer()
      bcAcceptedObjects.InsData(c4d.TakeBase, "") # only allow BaseTakes to be accepted
      bcLinkBox = c4d.BaseContainer()
      bcLinkBox.SetData(c4d.DESC_ACCEPT, bcAcceptedObjects)
      self.linkBox = self.AddCustomGui(2001, c4d.CUSTOMGUI_LINKBOX, "My Link", c4d.BFH_SCALEFIT | c4d.BFV_CENTER, 0, 0, bcLinkBox)
      

      I turned this thread into a question.

      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: Confusing ToolData content

      Hi,

      no your script is not wrong. There's just a bit more to it.

      1. To state the obvious, there's no reason, why different tools should have the same ID for a parameter's data, even if these parameters are called identically in the user interface.
      2. Just like every other NodeData derived entity, a tool does not necessarily store it's parameters in the BaseContainer. Or it may store values in the BaseContainer, only, if it's different from default. Either way, you have no guarantee to find all parameters in the BaseContainer. Rather use GetParameter() (so in your case for example tool.GetParameter(2108, c4d.DESCFLAGS_GET_0))

      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: Confusing ToolData content

      Hi,

      you can also use the Description.

      With a small loop, you can get information about a tool's parameters and their type:

          toolID = doc.GetAction()
          tool = c4d.plugins.FindPlugin(toolID, c4d.PLUGINTYPE_TOOL)
          desc = tool.GetDescription(c4d.DESCFLAGS_DESC_0)
          for bc, paramid, groupid in desc:              # Iterate over the parameters of the description
              print bc[c4d.DESC_NAME], paramid[0].dtype  # Print the current parameter name and type
      

      It sounds a bit, as if you try to create some kind of undo system for tools. Something Cinema 4D does not have currently. The standard undo system for example works by cloning instances, something that is not possible with tools. But of course the cloning automatically takes care of the entire instance's state, regardless, if parameters are stored in the BaseContainer or if the complete state is really defined by parameters.
      So, just be aware, even with the above approach, there might still be information stored inside of a tool, which may not be reflected by the Description, either. I have no examples for this, it is more a word of a warning, something like this might come up.

      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: INCLUDE user-defined res files

      Hi,

      no, you are not! ☺
      Really there are no stupid questions and please do not delete such posts. Especially not, if you already invested time in posting the correct answer. We'd rather see this as knowledge others might benefit from in the future.

      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: Execute a Python Code Within PyCharm that Connects to C4D?

      Sorry for joining in so late. And I think, all relevant points have already brought up.
      I just wanted to add one twist or slightly different point of view:

      c4dpy is a so to say "standalone python interpreter" with access to Cineama 4D's api.

      Actually c4dpy is a full headless Cinema 4D, which can be used as a Python interpreter in IDEs.

      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block

    Latest posts made by a_block

    • RE: CRITICAL: Stop when calling SetWorldPluginData

      Thanks for the offer. much appreciated. But your explanations were good and plenty as usual.
      I think, I know exactly what is going on.

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: CRITICAL: Stop when calling SetWorldPluginData

      Thanks so much, Ferdinand.
      This helped me a lot and also this message being changed in 2023.2 explains a lot for me.

      Unfortunately at the current point I am not in a position to make any of our code public. In consequence there is little to learn here for other readers. Sorry!

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • CRITICAL: Stop when calling SetWorldPluginData

      Hi,

      I'm developing a Python plugin on Win with C4D 2023.2.0 / 2023.CL399467.5638.

      The question is, what does it mean, if i get "CRITICAL: Stop [btree_container.cpp(2551)]" in debug console, when calling c4d.plugins.SetWorldPluginData()?

      At first I thought, it was related to me stupidly trying to call c4d.plugins.SetWorldPluginData() from a thread. But after fixing this, I now get this on the main thread, too. I double checked, that the types when accessing the containers are correct (I mean, when writing into or reading from my own plugin's "world container").
      Pretty sure, I overlooked something stupid, therefore I hope any hint on what may cause above critical stop will point me into thee right direction.

      Thanks in advance,
      Andreas

      posted in Cinema 4D SDK python 2023
      a_blockA
      a_block
    • RE: Quicktabs in dynamic prefs description

      No worries. Thanks for trying. 🙂

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: Quicktabs in dynamic prefs description

      Hi Ferdinand,

      always a pleasure to ask you something. Thanks, for the quick and thorough answer.

      I am as stupid as a slice of bread (no insult to the bread).
      I hadn't even considered including Fbase, as it is no "filter" plugin and I did not want the Presets group.
      So, my actual question was more. how to create those tabs on top dynamically myself?
      But of course I can simply hide the preset group. Bam, working nicely. Forget the original question.

      Thanks again for your effort!

      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • Quicktabs in dynamic prefs description

      Hi,

      I am aware of this thread (and even gave the answer there myself): https://developers.maxon.net/forum/topic/8853/11700_quicktabcustomgui-inside-getddescriptionsolved

      I just want to ask if anything has changed in this regard. So:
      I'd like to achieve a "tabbed group" switching, as seen below in Im-/Exporter preferences. In my plugin I would need to be able to provide this with a dynamic description inside of a PrefData. Is it still true, that I have no means to setup and configure a CUSTOMGUI_QUICKTAB from code in a description? Or are there other widgets by now, which could serve the same purpose?
      A QUICKTABSRADIO widget doesn't quite cut it, as it is lacking the multi selection.

      84eee80b-9ea7-4a1c-b93e-2f8f591e290a-image.png

      I tagged the post as R23 as ideally this would be the minimal version, I'd need such functionality.

      Any ideas would be much appreciated.
      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • RE: Asset Browser: Add Watch Folder

      Thanks, Ferdinand. I'll take a closer look as soon as I find the time.

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • Asset Browser: Add Watch Folder

      Hi,

      I was pretty excited, when the Watch Folders for the Asset Browser got introduced.

      But trying to find a function or command to add a Watch Folder from Python API, I have to admit, I'm a bit lost. Is this possible?

      Cheers,
      Andreas

      posted in Cinema 4D SDK python
      a_blockA
      a_block
    • RE: Drag and Drop from GeUserArea in Python

      Hi Maxime,
      that's a bummer.

      Just a few additions:

      is done by calling HandleMouseDrag. Your code is paused until the drag operation ended

      Yes, no objection. But it should be said, during this "pause" one does still receive messages, among them BFM_DRAGRECEIVE_START and BFM_DRAGRECEIVE. Just not BFM_DRAGEND. Which makes me think, if only the receiver would not "consume" this message, it could already work...

      From a pure implementation point of view, it also does make sense since it would make no sense if each drag operation have to support all possible managers

      I wouldn't want it differently. But I still think, the initiator of an action deserves result information. after all these years, I'm still wondering, what's this obsession with not delivering feedback to a caller. Yes, I'm looking at you CallCommand()...

      Finally it is not possible to drag objects directly to the viewport

      I didn't even consider, drag and drop could work differently for materials and objects, or objects not working at all. So, thanks for the info and avoiding even more headache on my end.

      I guess, we are back to the drawing board then.

      Anyway, greetings to the team.
      Cheers,
      Andreas

      posted in Cinema 4D SDK
      a_blockA
      a_block
    • Drag and Drop from GeUserArea in Python

      Hi,

      I know, this is a topic that got discussed several times in the past. Nevertheless I can not get it to work properly.

      The goal: Being able to drag a yet to be created object or material from my GeUserArea into C4D (desired targets: view port, Material Manager, Object Manager,...).

      I said "yet to be created". By this I mean, it is an asset from some library, which is not yet part of the document.
      I have two options:

      • Create and insert the asset before the drag and then remove it again, if the drag fails (either being escaped or dropped onto some forbidden place).
      • Or I do insert the asset into the document on successful drop.

      The beginning looked promising, HandleMouseDrag() seems to be the function for this scenario and at first it seemed to work as expected.

      But how on earth do I find out about the outcome of the drop?

      I do receive BFM_DRAGRECEIVE, but I do never get BFM_DRAG_FINISHED or BFM_DRAG_ESC to be true. Only BFM_DRAG_LOST seems to hold information. It is always jumps from false to true, when the user ends the drag in whatever way (escaped, dropped successfully, dropped on forbidden area, it doesn't matter).
      Yes, I do return the return value of SetDragDestination() from my Message() function, while in drag, as I found in this forum, that it's needed to notify C4D about my interest in the drag (which I started in the first place... Not being interested in the outcome of something I started feels a bit strange to me... a bit like firing a rocket and not being interested, if it actually started, exploded on the pad or actually reached its destination. Anyway...).

      And then there's an additional issue with dragged materials:
      The result is different, if the user drops it onto an object in viewport or Object Manager or onto the Material Manager. In the first case it works as expected (as long as I insert the material into the document), but in the latter case I end up with two material being created in the MM. So, when dropping onto an object C4D seems to assume, the material is already part of the document and only assigns it (but I am responsible for making it available in the document), while when dropping onto the MM, then C4D seems to automatically create a copy (so I should not insert it into the document myself).
      But how am I to decide, what to do and what to expect?
      Even if I had a way to find out about the success of the drop operation, I would still be lacking the information about the drop target.

      Any help would be much appreciated.

      Cheers,
      Andreas

      posted in Cinema 4D SDK python
      a_blockA
      a_block