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

    Adding Xref to PyGen, crashing of c4d

    Scheduled Pinned Locked Moved Bugs
    3 Posts 0 Posters 738 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

      On 06/12/2016 at 07:58, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   17, 18 
      Platform:   Windows  ;   
      Language(s) :       PYTHON  ;

      ---------
      Hello, small back to c4d
      I tried for friend  to make small clonner based at interactive xref-ops.

      If add Xref by op.SetParameter(c4d.ID_CA_XREF_FILE, 'xref.c4d', c4d.DESCFLAGS_SET_USERINTERACTION), in py-gen op. It crashed c4d.

      If normally add by console or script, all are ok.

      import c4d  
      import random  
        
      def main() :  
        null = c4d.BaseObject(c4d.Onull)  
          
        bt=doc.GetTime()  
        fps=doc.GetFps()  
        Frame=bt.GetFrame(fps)     
          
        if Frame == 0:  
            i = 1  
            while i < 5:  
                i = i + 1  
                testop = c4d.BaseObject(c4d.Oxref)  
                testop.SetAbsPos(c4d.Vector(i*400, 0, 0))  
                testop.SetParameter(c4d.ID_CA_XREF_GENERATOR, True, c4d.DESCFLAGS_SET_USERINTERACTION)  
                testop.SetParameter(c4d.ID_CA_XREF_FILE, 'xref.c4d', c4d.DESCFLAGS_SET_USERINTERACTION)  
                testop.SetParameter(c4d.ID_CA_XREF_OFFSET, c4d.BaseTime(random.uniform(0.0, 1.0)), c4d.DESCFLAGS_SET_USERINTERACTION)  
                testop.InsertUnder(null)  
        return null
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 07/12/2016 at 02:22, xxxxxxxx wrote:

        The thing is, you are doing user interaction stuff during execution of the scene pipeline (that's where the Python Generator code is being executing). No, user interaction is allowed in such places (see Threading Information).
        On the other hand, Cinema shouldn't crash, but handle the situation gracefully. I'll look into it and post a bug report.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 07/12/2016 at 03:58, xxxxxxxx wrote:

          Hello Andreas
          Thank you
          I decided to use for test small part of code by scripting py-gen op and xrefs. Failed at some moments.
          Will try to code in plug-in "body". maybe need to use own scheme of xref functionality(i read over forum, it is useless thing)

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