• 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!
  • PluginsHelpDelegate Info

    General Talk r21 r20 c++
    6
    0 Votes
    6 Posts
    860 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".
  • 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
    791 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
    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.
  • animation disregarded after toolplugin

    Cinema 4D SDK python r20
    8
    0 Votes
    8 Posts
    1k Views
    D
    But I appreciate that you where trying to make things more streamlined
  • 0 Votes
    24 Posts
    16k Views
    ManuelM
    arff, that's really strange, I'll send you a simple example and see if the error still happen on your system.
  • SendModelingCommand() in R20 and R21

    Moved Cinema 4D SDK r20 r21 c++
    8
    0 Votes
    8 Posts
    1k Views
    Danchyg1337D
    @m_adam MODELINGCOMMANDFLAGS::NONE works! Thanks again for helping me out!
  • Trigger Tag

    Cinema 4D SDK c++ r20 r21
    5
    0 Votes
    5 Posts
    624 Views
    C4DSC
    @m_magalhaes said in Trigger Tag: I though you were using a hidden BaseLink parameter on your tag to point to the other tag. Ah, didn't think about that. Clever.
  • Sample a shader in 3D space

    Cinema 4D SDK c++ classic api r21 r20
    16
    0 Votes
    16 Posts
    4k Views
    fwilleke80F
    Thanks, Paul! I'll try that out Cheers, Frank
  • Hide a tab group of a resource-based GeDialog

    Cinema 4D SDK r20 r21 c++
    8
    0 Votes
    8 Posts
    1k Views
    M
    Hi Frank sorry for the delay needed for this issue, I get the time to look at it, and this is the thing I should have checked first, but either in a GeDialog with a Layout created in a script, I'm not able to hide a tab. Since you said it was working previously, could you confirm you don't want to hide only the content (in your case the 3 StaticText) but also the tab in the tab entry, isn't? If yes could you provide a code sample because I would say even in a normal case I'm not able to reproduce. import c4d class Dlg(c4d.gui.GeDialog): def CreateLayout(self): if self.TabGroupBegin(10001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, tabtype=c4d.TAB_TABS): if self.GroupBegin(10010, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, title="First Tab"): self.AddStaticText(10011, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, name="Text01") self.GroupEnd() if self.GroupBegin(10020, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, title="Second Tab"): self.AddStaticText(10021, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, name="Text02") self.GroupEnd() self.GroupEnd() self.AddButton(10030, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, name="Remove First Tab") return True def Command(self, id, msg): if id == 10030: print self.HideElement(10010, True) print self.LayoutChanged(10001) return True def main(): global dlg dlg = Dlg() dlg.Open(c4d.DLG_TYPE_ASYNC) # Execute main() if __name__=='__main__': main() To me, the only way to remove a tab is to flush the complete group master of the TabGroup and re-add tabs except for the one you don't want. Cheers, Maxime.
  • Calling C4D via command line to find prefs folder

    Cinema 4D SDK r20 r21
    5
    0 Votes
    5 Posts
    671 Views
    M
    Hi, without further feedback, I'll set this thread as solved tomorrow. Cheers, Maxime
  • c4d.utils.RangeMap clampval funkyness

    Cinema 4D SDK r20 python
    2
    0 Votes
    2 Posts
    274 Views
    ManuelM
    Hi, thanks a lot. I've opened a bug entry for that one. It will be fixed in a futur release. Cheers, Manuel
  • Howto map polygon numbers before - after split

    Cinema 4D SDK r19 r20 r21 c++
    9
    0 Votes
    9 Posts
    1k Views
    C4DSC
    @m_magalhaes Thanks for the example. I am sure this will be helpful in future, however for now I am still stuck with the classic API to remain backwards compatible. While there isn't a readily available solution to the problem, a few options have been mentioned how to handle this. As such I will set the topic as solved.
  • FontData BaseContainer IDs

    Cinema 4D SDK python r20
    4
    0 Votes
    4 Posts
    860 Views
    S
    @m_adam I still don't understand how to get the id of parameters? How do I know that this parameter has id 500?
  • Render to Picture Viewer with fields problem.

    Moved Cinema 4D SDK
    7
    0 Votes
    7 Posts
    1k Views
    Danchyg1337D
    @m_adam Thank you for reply. I would probably send my code to your email to try to figure it out better. What i see so far is that in renderer, fields returns 0 for each point they sample. I have a function which samples fields and accepting a result to each vertex. For example imagine extrude with fields. In viewport i see extruded points, but in renderer everything is flat, like there is no field or it is so far to make any extrusion and returns 0. for each point. Second is more likely due to my tests.