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

    User Area and ScrollArea()

    Cinema 4D SDK
    r20 python
    2
    4
    520
    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.
    • P
      pim
      last edited by

      I am a bit confused about using ScrollArea() for my User Area (UA).
      I want to display a lot of textures in my UA.

      So, I created a UA with a scroll area and using the slider part of the textures are shown.
      However, it is a bit slow, because the textures are all drawn using DrawBitmap() in DrawMsg().
      I added SetClippingRegion(x1,y1,x2,y2), but that did not made things faster.

      Reading the manual, I see that I can use ScrollArea(), only showing a part of the total UA.

      Questions:

      • do I use ScrollArea() in DrawMsg()
      • do I still use DrawBitmap() to draw the textures?
      • if not where do I draw all the textures, I later on display only a part using ScrollArea().

      Could please provide some pseudo code or an example to show UA, DrawBitmap(), ScrollArea()?

      1 Reply Last reply Reply Quote 0
      • P
        pim
        last edited by pim

        So far I tried this, but no success.
        In Command of the main dialog, I do the ScrollArea() call.
        The 'visible' UA is 330x584. The actual (virtual) UA is larger in the y direction.

                    self.area.ScrollArea(0,584, 0, 584, 330, 2*584)
                    #self.area.Redraw()
        

        Adding Redraw() dit not help.
        I added no ScrollArea() in the Area class.

        1 Reply Last reply Reply Quote 0
        • M
          m_adam
          last edited by m_adam

          Hi @pim do you really want to use ScrollArea, to manually scroll your GeUserArea, or you want to have an external ScrollGroup that will scroll your GeUserArea automatically (If this is the case then you can find an example in Redrawing GeUserArea in ScrollGroup with Slider Input.
          Note that there is a behavior change in R21 for GeUserArea, now only the needed part is redrawn, so you may see some speeded in R21+.

          But I don't think the Scroll Area will help you to provide faster result in any case, what the function does, is simply offsetting the rendered area part but you still need to draw completely the GeUserArea with all the DrawBitmap, make sure to use BMP_NORMAL to have a faster result, moreover if speed is really the main issue you try to fix, I encourage you to read Profiling Python Plugins.

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • P
            pim
            last edited by

            Yes, I use the auto way.
            I thought that using ScrollArea() it would only display that part (no need to draw the other parts).
            So, fill the virtual UA once and then display parts of it using ScrollArea().

            But if "you still need to draw completely the GeUserArea with all the DrawBitmap", there will be no speed benefit.

            I will try it under R21 and will read "Profiling Python Plugins".

            Thank you, Pim

            24fbc034-a80c-42f0-acb3-77deffeadaec-image.png

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