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

    Help with EditorWindow class

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 350 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 22/03/2012 at 11:51, xxxxxxxx wrote:

      Hey guys,
      I'd like to try out the functions in this class. But I can't figure out the proper way to construct it.

      Example from the docs:  x, y = win.Screen2Local()

      That really doesn't help much. Since it doesn't say where "win" comes from. Or show how to instantiate the class. And the function doesn't even work substituting values for x&y.

      This is my best guess where "win" comes from. But I can't figure out how to use any of the functions in it:

      import c4d  
        
      def main() :  
        
        win = c4d.gui.EditorWindow  
        win.Local2Screen(100,200) #Error: requires a c4d.gui.EditorWindow object
      

      Appears to be wrong.
      Can anybody offer some small example how the Local2Screen() function is supposed to be written?

      -ScottA

      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 22/03/2012 at 14:14, xxxxxxxx wrote:

        Basedraw has a GetEditorWindow member.

        http://www.thirdpartyplugins.com/python/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseView/BaseDraw/index.html#BaseDraw.GetEditorWindow

        i don't think you can just create an instance of editorwindow like in your example.

        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 22/03/2012 at 14:17, xxxxxxxx wrote:

          Hi Scott!

          1. You have missed the parantheses used to instantiate the class.

          2. Anyway, you cannot instantiate the c4d.gui.EditorWindow class. It must be obtained from a c4d.BaseDraw object or used in methods were it is given as a parameter (e.g. draw-functions).

          3. Screen2Local() and similiar methods do not accept arguments, but return a tuple of 2 values that define the offset, i.e. the values you have to add to the values you want to convert.

          bd     = doc.GetActiveBaseDraw()
          win    = bd.GetEditorWindow()
          ox, oy = win.Local2Screen()
          print 200+ox, 100+oy
          

          Cheers,
          -Niklas

          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 22/03/2012 at 16:40, xxxxxxxx wrote:

            Thanks Guys.🍺

            -ScottA

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