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

    XRef Reference

    SDK Help
    0
    4
    465
    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
      Helper
      last edited by

      On 23/02/2016 at 08:03, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hi,

      I'm trying to set the reference file of an XRef object but without success.
      I tried with SetFilename on ID_CA_XREF_FILE and ID_CA_XREF_REF_NAME.
      I know there is a limitation for doing so with Python, but is it possible to do it with C++?

      Originally posted by xxxxxxxx

      I'm afraid it's not currently possible to set the file for an XRef object.

      Actually the issue isn't related to XRef objects. The real limitation is that Filename parameters cannot be set. We're aware of it and we'll try to fix it ASAP.

      Thanks in advance!

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

        On 24/02/2016 at 01:19, xxxxxxxx wrote:

        Hi Yann,

        There isn't such a limitation with C++ but C4DAtom::SetParameter() has to be called with DESCFLAGS_SET_USERINTERACTION flag to set ID_CA_XREF_FILE:

        BaseObject* xref = BaseObject::Alloc(Oxref);
        if (xref)
        {
          doc->InsertObject(xref, nullptr, nullptr);
          
          Filename xrefFile = "path/to/xref.c4d";
          xref->SetParameter(ID_CA_XREF_FILE, xrefFile, DESCFLAGS_SET_USERINTERACTION);
          EventAdd(EVENT_ANIMATE);
        }
        

        Note the Python limitation with Filename parameters was fixed in R16 SP3 (R16.050).

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

          On 24/02/2016 at 02:51, xxxxxxxx wrote:

          Hi Yannick,

          Thank you very much for you help. 🙂
          It seems to work with the flag DESCFLAGS_SET_USERINTERACTION to set ID_CA_XREF_FILE and DESCFLAGS_SET_PARAM_SET to set ID_CA_XREF_REF_NAME.

          I'm trying to replace an existing Xref reference by a copy of the referenced file located somewhere else and with a different name.

          Is there a simple way to get rid of the dialog message, to perform a transparent operation without interacting with the user?

          _<_img src="http://www.xsyann.com/fc4d/xref.png" height="268" width="540" border="0" /_>_

          I can avoid this dialog by replacing C4DOS.Ge->OutString by a function returning GEMB_R_YES before the call and then restore the orignal one after, but maybe there a more proper way to do it...

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

            On 25/02/2016 at 02:27, xxxxxxxx wrote:

            Hi Yann,

            Originally posted by xxxxxxxx

            Is there a simple way to get rid of the dialog message, to perform a transparent operation without interacting with the user?
            _<_img src="http://www.xsyann.com/fc4d/xref.png" height="268" width="540" border="0" /_>_

            I can avoid this dialog by replacing C4DOS.Ge->OutString by a function returning GEMB_R_YES before the call and then restore the orignal one after, but maybe there a more proper way to do it...

            We can't recommend such hacky solution but it's the only way to get rid of the dialog...

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