• Modifier dependencies

    Cinema 4D SDK c++ r19 r20 r21 s22
    6
    0 Votes
    6 Posts
    946 Views
    rsodreR
    Hi @m_magalhaes This was research for a feature I'll start implementing soon, and possible refactor. I'll mark as solved and if there's anything else I need I'll open it again. Thanks.
  • 0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hi, thanks, that answers all my questions. Cheers, zipit
  • CommandData trigger from GeDialog

    Cinema 4D SDK c++ r19 r20 r21
    6
    0 Votes
    6 Posts
    643 Views
    C4DSC
    Nevermind. Trying to explain will probably lead us too far. I was only wondering if messaging was possible between a CommandData and its GeDialog.
  • Create Proper Hierarchical Data for TreeView?

    General Talk r21 python
    11
    0 Votes
    11 Posts
    2k Views
    B
    Thanks for the clarification. Have a great day ahead!
  • Buggy GeDialog Local2Global and Local2Screen

    Cinema 4D SDK c++ r20 r21
    8
    1
    0 Votes
    8 Posts
    956 Views
    C4DSC
    @r_gigante Sorry Riccardo, I do not understand your reply. I had tried with empty as well as non-empty dialogs. Both as DLG_TYPE::ASYNC and DLG_TYPE::ASYNC_POPUPEDIT. Still with these 4 combinations I do not get appropriate values for the global position. Bool MyDialog::CreateLayout() { Bool res = GeDialog::CreateLayout(); GroupBegin(0, BFH_SCALEFIT | BFV_SCALEFIT, 2, 0, ""_s, 0); AddButton(ACTION_1, BFH_CENTER | BFV_CENTER, 200, 10, "button A"_s); AddButton(ACTION_2, BFH_CENTER | BFV_CENTER, 300, 10, "button B"_s); AddEditText(ACTION_3, BFH_CENTER | BFV_CENTER, 500, 10); GroupEnd(); return res; } Bool MyCommand::Execute(BaseDocument* doc) { if (mDlg.IsOpen()) { mDlg.Close(); return true; } BaseContainer bc; if (GetInputState(BFM_INPUT_MOUSE, BFM_INPUT_MOUSELEFT, bc)) { const Int32 mx = bc.GetInt32(BFM_INPUT_X); const Int32 my = bc.GetInt32(BFM_INPUT_Y); const Int32 w = 50; const Int32 h = 50; mDlg.Open(DLG_TYPE::ASYNC /*ASYNC_POPUPEDIT*/, TEST_COMMAND_PLUGIN_ID, mx, my, w, h, 0); ApplicationOutput("Mouse cursor at @, @", mx, my); Int32 dlgX = 0; Int32 dlgY = 0; mDlg.Local2Screen(&dlgX, &dlgY); ApplicationOutput("Dialog created at @, @ (screen)", dlgX, dlgY); dlgX = 0; dlgY = 0; mDlg.Local2Global(&dlgX, &dlgY); ApplicationOutput("Dialog created at @, @ (global)", dlgX, dlgY); } return true; } Additionally, when activating the plugin when Cinema4D is fullscreen, the dialog gets positioned at the expected coordinates. But the position of the dialog is nowhere near the expected position if the plugin is activated when the Cinema4D window is not full screen. It seems as if the mouse coordinates relative to the application window are applied relative to the screen origin. Which means that if: 1 Cinema4D is not full screen 2 and offset from the top left corner of the screen by an amount X 3 assuming the mouse position is at coordinate mx from the Cinema4D's main window's top left corner The dialog ends up at mx from the screen's top left corner, instead of the expected X + mx. (All the above was tested with R20 only, since I have refrained from further R21 development) Unfortunately, I have moved on and am currently not focused on this particular plugin anymore. As such, I may have missed some details. I will need to find the time to pick up where I had left.
  • Which lock to use?

    Cinema 4D SDK r21 r20 s22 c++ macos windows
    3
    0 Votes
    3 Posts
    358 Views
    fwilleke80F
    Always using the threadIndex, of course Thanks, I'll try that!
  • 0 Votes
    5 Posts
    560 Views
    M
    Hi @fwilleke80, unfortunately, I confirm the shader effect is almost always dirty. I don't have any real workaround maybe you can retrieve all noises and compute their dirtiness, but this is indeed a very hard topic to handle all cases because you will also need to handle the actual parameter of the shader effector itself. Cheers, Maxime.
  • PluginsHelpDelegate Info

    General Talk r21 r20 c++
    6
    0 Votes
    6 Posts
    865 Views
    ManuelM
    hi, there's nothing more to do in R21/S22, you should maybe post your project to see if there's something wrong. Cheers Manuel
  • Inconsistent GeDialog::Open position

    Cinema 4D SDK r20 c++ r21
    5
    0 Votes
    5 Posts
    664 Views
    C4DSC
    Extra info! While I had set this topic as solved, without an actual WORKING solution being provided, I simply wanted to point out for future reference that R16 - R19 has a slight different behaviour. As with R20 and R21 the first time the dialog is opened it gets positioned centered on the current mouse position. On all subsequent opening it gets positioned with its upper left corner at 0,0. Something got "fixed" between R19 and R20, but not "fixed enough".
  • Unexpected ShowPopUpDialog Behavior

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    307 Views
    B
    @zipit Thanks for the response. You are right. It should have worked if there is padding between buttons. For now, I just chose either buttonData["w"] or buttonData["h"]. And it works as expected. RE: hard to read your code due to the lack of documentation and its disregard of PEP8 Sorry about that.
  • 0 Votes
    4 Posts
    766 Views
    fwilleke80F
    Ah, great, thank for checking! Then I don't need to worry about my bmp code Cheers, Frank
  • Mouse positions and screen dimensions

    Cinema 4D SDK r20 r21 c++
    17
    4
    0 Votes
    17 Posts
    2k Views
    ManuelM
    hi, sorry, it get out of my mind. Cheers, Manuel
  • Cross platform screencapture code

    General Talk
    5
    0 Votes
    5 Posts
    792 Views
    M
    Hi @C4DS, just to confirm that there is nothing built-in Cinema 4D. For python most of the library in the end only reroutes through OS call and does have a system dependant call, so you will probably end with something like that also in C++. Cheers, Maxime.
  • 0 Votes
    3 Posts
    593 Views
    oli_dO
    Merci Maxime ! It's work perfectly !
  • Identify Critical Stop Please?

    Cinema 4D SDK python r21
    6
    0 Votes
    6 Posts
    1k Views
    K
    @m_magalhaes said in Identify Critical Stop Please?: hello, For your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here. Q&A New Functionality. About the error it's related to FileName. But we need more information to help more. Be careful about the other thread, it may happen that we add stuff and the line will not refer to the correct DataType anymore. Cheers, Manuel Dammit! No wonder my code keeps breaking... I can't even follow simple forum instructions lol! But hey, at least I got it down to one link. Haha, progress! Yes, Filename, that actually makes perfect sense, so I'm pretty confident I've conquered this error. You're right that I shouldn't rely too strongly on those line numbers. Hell, the next bug fix could make that info obsolete, let alone a reference from years ago. But sometimes you can glean value from outdated info. Maybe in the future line 277 doesn't refer to Filename, but if that error pops up and all my Filename calls look to be in good order I might be able to make some guesses that increase my luck in identifying the issue faster. For instance, I might look at string or static text parameters first, thinking that like datatypes may have been grouped together in the source code. If 329 doesn't refer to baselink in the future I might start looking at in/exclude boxes or shader links first for the same reason. Maybe the list of datatypes in the description manual in the sdk is ordered how they are in ge_container.h and I can use that to choose my next lead. Shot in the dark type stuff, for sure, but maybe gets me generally in the right direction. You know what, this may have to do with me tracking down a weird behavior where Init() seemed to be the cause of every parameter invoking a MSG_DESCRIPTION_POSTSETPARAMETER message on any parameter change... but I have both debugging AND pandemic fog on my brain, so I don't even know exactly which thing I was doing wrong that may have been the culprit, so there's no point getting into all that... doesn't help that a VS Code update seems to like breaking my local git repo's randomly, so that makes reviewing previous code fun. In any case, the error hasn't popped up at all after ensuring all my base container calls were proper and there were no missing parameter initializations. Not that it was a readily reproduce-able error, just one that would pop up sometimes after a heavy testing session... so I had to do a lot of those to ensure it's really gone. But it does raise a question. Since the Filename object doesn't exist in python, what's the best way to initialize it? Docs say it's a string, but I saw something in a forum post that someone was initializing their filename parameter directly through the base container. I figured this had to do with how the python wrapper is internally converting the path to Filename object or something, so that's what I've been doing, but that WAS from 2013. So which is the proper way to initialize it? self.InitAttr(node, str, c4d.ID_FILENAME_PARAMETER) or data.SetFilename(c4d.ID_FILENAME_PARAMETER, "") And even if it's the former, do I set its default value through the basecontainer or in the normal way like so: node[c4d.ID_FILENAME_PARAMETER] = "" @r_gigante said in Identify Critical Stop Please?: Hi @kvb, with regard to the scope and purpose of the CriticalStop I warmly recommend you to have a look at: FAQ CriticalStop() Debug and Output Functions These pages properly explain how the CriticalStop is used in Cinema 4D, how it can be used in plugins and what to expect when it's hit. In you case, as already pointed out by @m_magalhaes , it's likely you're using a GeData::GetFilename() with a GeData whose type was not a Filename. Please recheck your code and if you don't spot the issue, provide us with an example or snippet to reproduce it. Cheers, R Thanks for the links. They'll come in handy on my next project, which will be in c++ (and I will be abusing the hell out of all the debugging options!). Could it have been caused by the filename returning None? Is that even a thing or just something I noticed while I was missing any initialization on my Filename parameter? I can't see it being anything else... unless an empty string could trigger that error? Thanks all! Kevin
  • GetWidth() for GeDialog?

    Cinema 4D SDK r21 python
    4
    0 Votes
    4 Posts
    402 Views
    B
    Hi @m_adam . Apologies for bringing up the thread again. I just have a follow up question. The def Message works well for the consecutive duration of the dialog. But for the initial life (i.e on startup), the def Message will not be executed . Is there a way to determine the width and height of the dialog upon its startup?
  • Draw Methods doesn't work on GeUserArea

    Cinema 4D SDK r21 python
    5
    0 Votes
    5 Posts
    417 Views
    B
    @zipit Thanks for pointing it out. It now works as expected.
  • 0 Votes
    3 Posts
    419 Views
    C4DSC
    @m_magalhaes said in GeUserArea - RemoveLastCursorInfo not compatible with ActivateFading: ActivateFading is also using RemoveLastCursorInfo internally. I more or less assumed this was the case. As such I went with an alternative solution using RemoveLastCursorInfo to be able to detect the mouse leaving the GeUserArea, while providing an own implementation for fading in and out. Thanks for confirming.
  • GeUserArea ActivateFading and AdjustColor

    Cinema 4D SDK c++ r19 r20 r21
    6
    0 Votes
    6 Posts
    673 Views
    C4DSC
    @PluginStudent Yup ... it's official, I need glasses on top of my glasses. Thanks for pointing it out.