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

    doc.GetHighest - Program-crash

    Scheduled Pinned Locked Moved PYTHON Development
    12 Posts 0 Posters 1.2k 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 13/07/2011 at 21:24, xxxxxxxx wrote:

      perhaps try to add an if() statement to make sure there is an active object first? 
      something like:

      import c4d
      from c4d import documents as docs

      doc = docs.GetActiveDocument()
      obj = doc.GetActiveObject()

      if obj != None:
          print doc.GetHighest(c4d.Ostage,False).GetName()

      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 14/07/2011 at 03:58, xxxxxxxx wrote:

        The commando is not searching for the highest active object, it is searching for the highest object in hierarchy. The program crashes, when finding a stage object, doesn't visible in renderer.

        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 14/07/2011 at 06:50, xxxxxxxx wrote:

          I can confirm this on Windows XP 32 Bit, but the Method crashes Cinema in any way I use it.

          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 14/07/2011 at 09:05, xxxxxxxx wrote:

            My OS: Win 7 64 bit - Ultimate

            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 14/07/2011 at 15:43, xxxxxxxx wrote:

              Ok, so i tested out your code in a new scene on my mac pro and i got no crashing and the script worked.

              here it is

              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 14/07/2011 at 17:06, xxxxxxxx wrote:

                thanks,
                but when i set the stage to invisible, the program crashes, too 😞

                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 15/07/2011 at 03:13, xxxxxxxx wrote:

                  Hi, I can confirm this crash. This needs to be fixed.

                  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 15/07/2011 at 04:17, xxxxxxxx wrote:

                    maybe the code for the commando will become public? This would be nice for working with it 🙂

                    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 15/07/2011 at 10:03, xxxxxxxx wrote:

                      confirmed. once the stage object is made invisible, it crashes. definitely a bug.

                      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 15/07/2011 at 12:20, xxxxxxxx wrote:

                        Originally posted by xxxxxxxx

                        maybe the code for the commando will become public? This would be nice for working with it 🙂

                        You can do the iteration by hand like this:

                        import c4d  
                        from c4d import gui  
                          
                        def SearchOM(op) :  
                          if not op: return  
                          if op.GetDown() : return op.GetDown()  
                          while not op.GetNext() and op.GetUp() :  
                              op = op.GetUp()  
                          return op.GetNext()  
                          
                          
                        def main() :  
                          
                        obj = doc.GetFirstObject()  
                        while obj:  
                           objtype = obj.GetType()  
                           mode = obj.GetEditorMode()   
                           if objtype == c4d.Ostage and mode == c4d.MODE_UNDEF: #If the Stage tag has grey dots       
                              obj.SetBit(c4d.BIT_ACTIVE)                        #Select it in the OM  
                              break                                             #We found the first one. So break out of the loop   
                           obj = SearchOM(obj)  
                        c4d.EventAdd()  
                          
                        if __name__=='__main__':  
                          main()
                        

                        The three modes for those little dots are: c4d.MODE_ON, c4d. MODE_OFF, c4d.MODE_UNDEF.

                        -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 21/07/2011 at 04:11, xxxxxxxx wrote:

                          Thank you ScottA

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