Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

How to assign target object to target expression.

 Post Reply Post Reply
Author
Message
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 44
Post Options Post Options   Quote amlendra Quote  Post ReplyReply Direct Link To This Post Topic: How to assign target object to target expression.
    Posted: 2018 Feb 26 at 5:37am
I have created a camera and assigned it a  target expression.

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

I able to assign target object to the target expression using drag and drop but here I want to set target object through the C++ API. Please do the needful.Cry
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1805
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Feb 27 at 7:39am
Hi,

this is just a matter of setting the right parameter of the Target tag.

One option to find out about parameters is to simply drag the parameter (grab its name) to the Commandline (the input field below the Console). Another option is to check the resource files directly, in this case it's in <C4D install path>/resource/modules/c4dplugin/description/ttargetexpression.res, easily found if you know the ID of the entity (here Ttargetexpression) already.

So, with the above you get TARGETEXPRESSIONTAG_LINK. And then it's just a matter of tag->SetParameter(TARGETEXPRESSIONTAG_LINK, object, DESCFLAGS_SET_0).

One more note on your code, you shouldn't cast the Target tag into a Texture tag.

Last note, I moved this thread to the SDK Help forum, as you seem to prefer C++ instead of Python.

Cheers,
Andreas
SDK Support Engineer
Back to Top
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 44
Post Options Post Options   Quote amlendra Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Feb 28 at 5:23am
Thanks, Andreas Block, My problem is solved.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.