BaseDocument.GetBaseDrawCount() Always returns 40
On 25/01/2018 at 16:17, xxxxxxxx wrote:
Cinema 4D Version: 19
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
On 26/01/2018 at 04:20, xxxxxxxx wrote:
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...
On 12/02/2018 at 23:08, xxxxxxxx wrote:
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?