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

    How to add a erroe window?

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 1.0k 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 07/03/2011 at 19:21, xxxxxxxx wrote:

      Hi all
      I come from China, and I can not find a man who study python for Cinema 4D around me.
      so,I guess there is the only place which I can be helped.
      I hope you can understand what I said:)

      And there is my plugin:

      ###############################################################
      import c4d 
      from c4d import gui

      def main() : 
      doc.StartUndo()  
      objList = doc.GetActiveObjects(childs=True)
      for obj in objList: 
      doc.AddUndo(c4d.UNDOTYPE_CHANGE,obj)  
      obj.SetRelPos(c4d.Vector(0,0,0))
      obj.SetRelRot(c4d.Vector(0,0,0))
      c4d.EventAdd() 
      doc.EndUndo()

      if __name__=='__main__': 
      main()

      #######################################################################

      the plugin  let the object back to (0,0,0)  #position and rotation
      but, I just want add a message window when none object have be selected, and the sys will show the window with some words(just like :"please select a object frist!") to users.

      But, I don`t know how to add it !!!😢

      So, I hope you can help me.

      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 08/03/2011 at 02:32, xxxxxxxx wrote:

        Hi
        it's from gui, >> gui.MessageDialog

          
        import c4d   
        from c4d import gui   
          
        def main() :   
         doc.StartUndo()  
         objList = doc.GetActiveObjects(childs=True)  
         if objList:   
          for obj in objList:   
        doc.AddUndo(c4d.UNDOTYPE_CHANGE,obj)  
        obj.SetRelPos(c4d.Vector(0,0,0))  
        obj.SetRelRot(c4d.Vector(0,0,0))  
         else:  
          gui.MessageDialog("Please select me!!!")  
         c4d.EventAdd()   
         doc.EndUndo()   
        if __name__=='__main__':   
         main()   
        
        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 08/03/2011 at 02:42, xxxxxxxx wrote:

          thinks:)
          you are so kind!!!🙂

          And I think I should study python more hard than before

          Have a nice day:)

          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 08/03/2011 at 05:03, xxxxxxxx wrote:

            Studieng the Documentation would be more senseful. 🙂

            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 08/03/2011 at 05:15, xxxxxxxx wrote:

              thanks a lot 🙂

              you are good people ~😄

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