Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > Bug Reports
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

BaseDocument.GetBaseDrawCount() Always returns 40

 Post Reply Post Reply
Author
Message
Donovan Keith View Drop Down
Member
Member


Joined: 2002 Oct 30
Location: United States
Online Status: Offline
Posts: 199
Post Options Post Options   Quote Donovan Keith Quote  Post ReplyReply Direct Link To This Post Topic: BaseDocument.GetBaseDrawCount() Always returns 40
    Posted: 2018 Jan 25 at 4:17pm

User Information:

Cinema 4D Version:   19 
Platform:      
Language(s):       PYTHON  ; 

---------


"""Print BaseDrawCount
prints the document's BaseDrawCount()"""

import c4d
from c4d import gui

def main():
    if not doc:
        return
    
    bd_count = doc.GetBaseDrawCount()
    print bd_count

if __name__=='__main__':
    main()


No matter how many ViewPanels I have open, or how they're split, I always get `40`.
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1822
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Jan 26 at 4:20am
Hi Donovan,

can you please verify, it's actually returning 40?
I tested here and it seems to work, although I have to admit it may not be immediately obvious.

Here by default BaseDrawCount() returns 4, even if there's only for example perspective view visible in the view panel. But you can switch to the four split views. And all BaseDraws needed for these do exist. For example they will store the zoom state and position each split view, so it can be restored after switching to single view and back to split.

Now, when you create an View Panel from the Window menu, then BaseDrawCount() will return 8. For the same reason as above, you can again split this view panel in four views.

And BaseDrawCount() will continue to return 8, even if this new View Panel gets closed. Again, for the same reason, after re-opening it, it will still show the same views as before closing.

So, the behavior might seem a bit strange, but it's not a bug, assuming yours is not really returning 40 all the time...



Edited by Andreas Block - 2018 Jan 26 at 4:20am
Cheers,
Andreas
SDK Support Engineer
Back to Top
Donovan Keith View Drop Down
Member
Member


Joined: 2002 Oct 30
Location: United States
Online Status: Offline
Posts: 199
Post Options Post Options   Quote Donovan Keith Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Feb 12 at 11:08pm
Hey Andreas,

Thanks for clarifying. I think the issue is that I had opened up 10 different view panels at one point and then closed them. It seems (as you describe) C4D keeps a memory of any view panel that has been opened.

With that in mind, do you know of any way of figuring out which view panels are currently open/visible to the user?
Thanks!

Donovan
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.