Set target object for TargetExpressionTag
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2003 at 09:47, xxxxxxxx wrote:
Still not making progress. The .res file says "Obase" which one presumes to be a BaseObject. Well, GeData() does not have a BaseObject-argument constructor. Another file says "ObjectLink". What the heck is that? There is no direct BaseLink for BaseObject (or its parents). Tried BaseContainer (GetData()) and that didn't work.
Here's my take on this, and probably most application SDK's for that matter. There are two ways to go through a series of points to get from home to a destination. You can be given a map with topological indicators (streets, trees, buildings, hills, intersections+directions, doesn't matter), the points being marked, which serves as a representational means to do the task. Or you can be given a list of addresses (or trees by type, or building names, or just intersections) but no instructions on how to get to them. I'm certain that at some point the basic framework of the SDK will become clear, but without the map, it's sort of like stumbling around looking for each address by going off in random directions.
GeData is a very important class (as is BaseContainer), but their generality with respect to specific class types makes me wonder how anyone can discover what's in them (barring cases where they are in control of all of the information - in which I am not).
Robert -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2003 at 12:23, xxxxxxxx wrote:
Anyone? Hello?
I've been through the examples, the docs, and 23 of pages of forum from the past year and still not too much more that I haven't figured on my own. Still not certain on how to link a Null Object as a target to a Camera Object or Light Object with a TargetExpression Tag.
I own all of these objects (and have pointers to them) and they have been added to the BaseDocument properly. Looks like it'll be nice to know how to set "Camera Dependent" as well - but don't expect that to be as difficult as setting the Target Object (TARGETEXPRESSIONTAG_LINK (?)) for the tag.
Here's some of the code that I've tried without success:{ BaseContainer* bc = baseTag->GetDataInstance(); //BaseObject* obj = bc->GetObjectLink(TARGETEXPRESSIONTAG_LINK, baseDoc); //obj = baseObj; bc->SetLink(TARGETEXPRESSIONTAG_LINK, baseObj); //baseTag->SetContainer(bc, TRUE); bc->SetParameter(DescID(TARGETEXPRESSIONTAG_LINK), GeData(*bc)); baseTag->Message(MSG_UPDATE); }
As you can see, I'm trying variations and combinations without any feedback.
Robert -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2003 at 12:42, xxxxxxxx wrote:
Argghhh. Got it! Suggestion: tutorials and examples - lots of tutorials and examples. How the hell is one supposed to know that this works:
bc->SetLink(TARGETEXPRESSIONTAG_LINK, (BaseList2D* )baseObj);
and this doesn't:
bc->SetLink(TARGETEXPRESSIONTAG_LINK, baseObj);
without going bald!
There is one, only one, reference to SetLink() in the examples and none that I can find on the forum. That's not exactly much information to work with. Mikael, you have oodles of code and experience. How's about making some it available in the Plugin Cafe examples section? That goes for the other veteran SDK developers.
Robert -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2003 at 13:38, xxxxxxxx wrote:
1. GeData has a BaseLink constructor:
AutoAlloc<BaseLink> link; link->SetLink(baseObj); targetTag->SetParameter(DescID(TARGETEXPRESSIONTAG_LINK), GeData(link), NULL);
2. GeData::GetType() will give you the type of the GeData.
3. I really don't see how "bc->SetLink(TARGETEXPRESSIONTAG_LINK, baseObj);" couldn't work when the. Was this a compiler error or a runtime error? (A BaseObject is-a BaseList2D, so it shouldn't be either.)
4. The comment in the header file (ObjectLink) is techincally accurate, but of course not normative and not in any formal language. The res file says all you need to know, that it's a LINK of type Obase. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2003 at 15:01, xxxxxxxx wrote:
1. Cool! Thanks for the info. Into my "SDK snippets" it goes!
2. Okay.
3. No compiler warnings or errors. Once I added the cast, it worked. And, I had realized that BaseObject is a derived class of BaseList2D, so it bugged me as well.
4. Right, just took a while to coalesce the scattered info to determine what an ObjectLink really meant (a link with a BaseObject) and how it related to setting the ID for the Tag.
Well, I was incorrect about setting "Camera Dependent". Can't seem to find anything related to this Bool value for the Ttargetexpression tag. I had no problems setting "Use Target Object" for the Camera object, but then it was easily found. Any ideas?
Thanks, Mikael!
Robert -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2003 at 23:54, xxxxxxxx wrote:
3. Sorry, but I'd really like to call user error on this one, or else we've found a compiler bug or something. If you get the time, please try removing the cast to verify that it wasn't something else you did at the same thing that solved the problem. (Though researching errors after they've been solved isn't fun, it's often the only way to really understand what was going on.)
5. Seems this was a very instructive task. The Ttargetexpression resource has INCLUDE Texpression, which in turn has a PRIORITY item. The PriorityData class has a PRIORITYVALUE_CAMERADEPENDANT flag.// Getting GeData priority; tag->GetParameter(DescID(EXPRESSION_PRIORITY), priority, 0); PriorityData* prioritydata = priority.GetCustomDataType(CUSTOMGUI_PRIORITY_DATA); GeData camdepdata = prioritydata->GetPriorityValue(PRIORITYVALUE_CAMERADEPENDANT); Bool camdep = camdepdata.GetBool(); // Setting (must get first, to keep mode and priority value) Bool camdep = TRUE; camdepdata->SetPriorityValue(PRIORITYVALUE_CAMERADEPENDANT, GeData(camdep)); tag->SetParameter(DescID(EXPRESSION_PRIORITY), GeData(CUSTOMGUI_PRIORITY_DATA, camdepdata), 0);
Please don't ask how you would have found this out yourself...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/03/2003 at 08:48, xxxxxxxx wrote:
3. Well, although my code has changed somewhat since then, I tried removing the cast and, indeed, it worked. So, must have been something else going on that it didn't like. It should be noted that the object was inserted into the document after the SetLink() call before and now is inserted before. Maybe that made a difference.
5. Ah! An Easter egg hunt. Glad you found it as I was going cross-eyed trying to find a connection. It's proximity to the priority setting in the AM definitely made me look down that path.
Thanks again,
Robert -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/03/2003 at 15:44, xxxxxxxx wrote:
Other than some fixes to your code, it does something unexpected. First, there is no GeData.GetBool(). Doesn't that suck. So, I got the GeData from GetPriorityValue() and check the GeData() type. It says that it's a LONG value and it printed as '0'. So, taking a guess, tried this:
// - Getting GeData priority; targetTag->GetParameter(DescID(EXPRESSION_PRIORITY), priority, 0); PriorityData* prioritydata = (PriorityData* )priority.GetCustomDataType(CUSTOMGUI_PRIORITY_DATA); GeData camdepdata = prioritydata->GetPriorityValue(PRIORITYVALUE_CAMERADEPENDANT); GePrint(LongToString(camdepdata.GetLong())); //Bool camdep = camdepdata.GetBool(); // - Setting (must get first, to keep mode and priority value) prioritydata->SetPriorityValue(PRIORITYVALUE_CAMERADEPENDANT, GeData((LONG)1)); targetTag->SetParameter(DescID(EXPRESSION_PRIORITY), GeData(CUSTOMGUI_PRIORITY_DATA, (CustomDataType)*prioritydata), 0);
But, guess what, it ends up setting the Priority (from normal '10') to 256. Now I'm really confused. Could the PRIORITY_FLAG_NOCAMERA have any bearing in this?
I'll keep playing with it, but this appears to be very difficult for a single bool setting...
Robert -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/03/2003 at 14:54, xxxxxxxx wrote:
As a follow-up, why didn't anybody mention that the LookAtCamera Tag example has this code:
Bool LookAtCamera::Init(GeListNode *node) { BaseTag *tag = (BaseTag* )node; BaseContainer *data = tag->GetDataInstance(); data->SetBool(LOOKATCAMERAEXP_PITCH,TRUE); GeData d; if (node->GetParameter(DescLevel(EXPRESSION_PRIORITY),d,0)) { PriorityData *pd = (PriorityData* )d.GetCustomDataType(CUSTOMGUI_PRIORITY_DATA); if (pd) pd->SetPriorityValue(PRIORITYVALUE_CAMERADEPENDANT,TRUE); node->SetParameter(DescLevel(EXPRESSION_PRIORITY),d,0); } return TRUE; }
Just for future reference
Robert -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/03/2003 at 09:51, xxxxxxxx wrote:
D'oh. Well, I guess the moral is to always search before you ask/respond...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/03/2003 at 10:16, xxxxxxxx wrote:
Just for future reference
----------------
already referenced here in the forum afaic remember. It was for me so I am pretty sure