Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Login

    Dialog differs inCOFFEE/SCRIPT/PLUG?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 265 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 29/06/2006 at 12:38, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.6 
      Platform:      Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      I use a regular COFFEE tag or the ScriptManager to debug snippets of code.
      When using the very same code for opening a OK dialog it works inconsistent...

      This code works fine in ScriptManager and in a COFFE expression plugintag.
      The dialog opens.
      But -not- in a regular COFFEE tag. The dialoge doesn't open.
      I can't find out why!

      It is as simple as possible. If op is selected, open dialog and deselect op.

      Cheers
      Lennart

        
      // ////test dialog  
      var opselected = doc->GetActiveObject(); // Get a active object  
      if (op != opselected) return; // if it is not op return  
        
      if (op == opselected) //else run  
      {  
      var result = TextDialog("Hey", DLG_OK);  
      if (result == DLG_R_OK) // when confirming clicking OK  
      {  
      op->DelBit(BIT_AOBJ); // deselect op  
      return;  
      }  
      }  
        
      // ////test dialog end  
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 03/07/2006 at 10:56, xxxxxxxx wrote:

        Stupid questions: Are you sure that op == opselected? Are you sure that the code is executed at all? Try putting in println() at strategic positions, to find out.
        Also, you shouldn't use dialogs within expression plugins. They will potentially be executed within a thread where GUI functions are not allowed.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 03/07/2006 at 12:26, xxxxxxxx wrote:

          Hi. Yes the code is executed. Any Code incl Println(); after the example is working. That is why i got stumped about it.

          Expression plugins is all I can manage 🙂 So I have no other choice...

          Cheers
          Lennart

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 03/07/2006 at 13:13, xxxxxxxx wrote:

            Then I'd say it's a thread issue. Both expression tags and expression tag plugins would be unsafe places to call GUI functions, but it seems only the latter are called from a thread at the moment.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post