THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/03/2011 at 17:19, xxxxxxxx wrote:
[USERFORM][p]User Information:[/p]Cinema 4D Version: R12
Platform: Windows ;
Language(s) : C++ ;
[p]---------[/p][/USERFORM] Hi!
I try to follow a link from a TargetExpression, but can't figure out how to do that ...
I need to know on which linked object the target-camera looks
op is the camera-object of type Ocamera
BaseTag* tag = op- >GetTag(Ttargetexpression);
**GeData p;
bool ok = tag->GetParameter(1001, p, DESCFLAGS_GET_0); // ok == true
LONG type = p.GetType(); // type == 133 ALIASLINK
BaseLink* bl = p.GetBaseLink(); // bl != null
**
BaseObject* target = (BaseObject * )bl;
but this cast fails, you can't call target->GetName() : you get an ESP error
and get wrong result for:
Vector position = target- >GetAbsPos();
position is it I'm intrested in.
I also tested: bl->GetLink, bl->ForceGetLink, but no luck as well
Could you post a working code snippet please?
Thanks a lot for assistance.