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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    TreeViewF and C4D crash

    Scheduled Pinned Locked Moved SDK Help
    13 Posts 0 Posters 964 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 01/01/2005 at 08:04, xxxxxxxx wrote:

      Quote: Originally posted by kuroyume0161 on 01 January 2005
      >
      > * * *
      >
      > This is from MAXON's ActiveObject.cpp SDK example:
      >
      > What were you saying?
      >
      > Robert
      >
      >
      > * * *

      I said that you should not return 0 (since I have crashed one of my tree views with this, too). That's why I have added this comment in the R9 API 😉

        
      virtual LONG           GetLineHeight(void *root,void *userdata,void *obj,LONG col, GeUserArea* area); // always return a value > 0 !  
      

      GetLineHeight is called for each column and the biggest of these values is taken. But since you have a LV_TREE column, the line height will always be > 0.

      Does "(unless you wait for the entire hierarchy to process - which is several thousand items)" mean that you can still work with Cinema after a some time or does it really crash (with an error message)?

      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 01/01/2005 at 08:56, xxxxxxxx wrote:

        I'm not using the R9 API. ;0)

        What should I return then? These are not fixed in height or width, but are set by the GUI depending upon the dialogs dimensions (etc.).

        If I attempt to do anything in C4D while it's processing, it will immediately go to "not responding" and need to be killed. If I wait until it's finished fifteen or twenty minutes later, it continues to work.

        This does not happen under 8.503 or 9.012 (C4D version) - same plugin compiled using R8.012 SDK.

        Thanks,
        Robert

        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 01/01/2005 at 09:41, xxxxxxxx wrote:

          I should also mention that the only column in my Tree is the text hierarchy - 'tree' LV_TREE - there are no icons. Can I just not implement these methods (I think that I tried this previously and received compiler errors - not certain)?

          Robert

          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 01/01/2005 at 10:30, xxxxxxxx wrote:

            If you only have a LV_TREE column you can leave this part of your code as it is.
            Could you please comment out the line
            ((TreeRoot* )root)->SetSelected((RuntimeItem* )obj);
            and test the speed? If this doesn't speed it up much I don't have more ideas...

            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 01/01/2005 at 11:11, xxxxxxxx wrote:

              'Kay. That solves the problem, but it renders my tree useless. I need to know which folder is selected in order to do that 'processing' that I don't want happening across all of the tree items when the mouse button is clicked beyond the right of the list. It is almost as if there is a 'ghost' column to the right of the tree hierarchy - again, only in 8.012.

              When a folder is selected and it contains files, file icons are displayed in another ListView (and the selected RuntimeItem pointer is stored in TreeRoot). Without Select(), I cannot do this.

              But, I don't want every folder Visited (hint) when a mouse button is clicked to the right & outside of the tree list text (column).

              See, this is what you get for only making one example of TreeViewCustomGui using all internal C4D features and not much else to go by. I used the ActiveObject.cpp example because that is IT.

              If I knew how to restrict the column width in a manner like Object Manager, that might avoid this without crippling the functionality of my plugin. ;/

              Robert

              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 01/01/2005 at 11:24, xxxxxxxx wrote:

                This means that you have to optimize your SetSelected function 😉
                First, you should check the value of mode. It may be SELECTION_NEW (obj will be the only selected element in the tree), SELECTION_ADD (add obj to the current selection) and SELECTION_SUB (remove obj from the selection). Currently you call SetSelected even if the item is deselected. It could happen that Select(..., SELECTION_SUB) is called for each item to deselect it if the user clicks outside the tree column.

                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 01/01/2005 at 11:31, xxxxxxxx wrote:

                  Yes, the mode. That's what made the difference.

                    
                            virtual void Select(void *root, void *userdata, void *obj, LONG mode)  
                            {  
                                 if (mode) return;  
                                 ((TreeRoot* )root)->SetSelected((RuntimeItem* )obj);  
                            }  
                  

                  When clicking to the right & outside, mode is set to 2 while it is set to 0 when clicking on an item. Problem solved!

                  Thanks,
                  Robert

                  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 01/01/2005 at 11:58, xxxxxxxx wrote:

                    You should check if mode != SELECTION_SUB instead of != 0. SELECTION_NEW is used when the user clicks on the element with the right mosue button. You will lose this event if you only check for != 0.

                    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 01/01/2005 at 12:43, xxxxxxxx wrote:

                      Actually, SELECTION_NEW is exactly what I want and it works in all versions (8.0, 8.2, 8.5, and 9.0). 🙂 There is no multi-select, so the selection is always new, not add (?).

                      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 01/01/2005 at 12:57, xxxxxxxx wrote:

                        Quote: Originally posted by kuroyume0161 on 01 January 2005
                        >
                        > * * *
                        >
                        > There is no multi-select, so the selection is always new, not add (?).
                        >
                        >
                        > * * *

                        It may be add if the user holds down the shift key and sub if ctrl is pressed. You could treat add as new and ignore sub.

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