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

    Issue with Target Expression tag

    SDK Help
    0
    3
    666
    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 20/03/2018 at 10:48, xxxxxxxx wrote:

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

      ---------
      In Target Expression tag not able to enable camera dependent option. In below code, I m creating a Target Expression tag for a camera.

      TextureTag* Tag = static_cast<TextureTag*>(TestCamera->MakeTag(Ttargetexpression));
      if (!Tag)
      return false;

      Tag->SetParameter(TARGETEXPRESSIONTAG_LINK, TargetObj, DESCFLAGS_SET_0);

      Tag->SetName("SetTarget");

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

        On 21/03/2018 at 09:55, xxxxxxxx wrote:

        As already mentioned in another thread of yours, you really shouldn't cast a Target expression tag into a Texture tag, rather treat it as a BaseTag.

        The camera dependent option is part of the priority. PriorityData a custom data type (CUSTOMGUI_PRIORITY_DATA). So in order to modify this parameter the code looks for example like so:

        	GeData d;
        	targetTag->GetParameter(EXPRESSION_PRIORITY, d, DESCFLAGS_GET_0);
        	PriorityData* prio = static_cast<PriorityData*>(d.GetCustomDataType(CUSTOMGUI_PRIORITY_DATA));
        	prio->SetPriorityValue(PRIORITYVALUE_CAMERADEPENDENT, true);
        	targetTag->SetParameter(EXPRESSION_PRIORITY, d, DESCFLAGS_SET_0);
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 22/03/2018 at 02:50, xxxxxxxx wrote:

          Thank you so much.

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