AutoKey() function broken in R11?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/10/2008 at 17:18, xxxxxxxx wrote:
Howdy,
Well, I'm making some progress on writing my own auto key function that is specific to my tag, but there is something puzzling about the Scale parameter. It seems that it's not detecting a change. I'm using the VectorEqual() function like this:
>
if(!VectorEqual(tcData->GetVector(TRANS_SCA),tData->GetVector(TRANS_SCA),0.01))
tcData is the "undo" cloned tag's BaseContainer, and tData is the tag's BaseContainer.
The AM resource is set up exactly like it is in the obase.res file:
>
GROUP \> { \> LAYOUTGROUP; COLUMNS 3; \> GROUP { VECTOR TRANS_POS { UNIT METER; ANIM ON; CUSTOMGUI SUBDESCRIPTION; } } \> GROUP { VECTOR TRANS_SCA { STEP 0.01; ANIM ON; CUSTOMGUI SUBDESCRIPTION; } } \> GROUP { VECTOR TRANS_ROT { UNIT DEGREE; ANIM ON; CUSTOMGUI SUBDESCRIPTION; } } \> }
(you can see that I used 0.01 in the VectorEqual() function because the step is set to 0.01 in the .res file)
But, it's not detecting a difference in the scale until the scale is at least over 3.0. Is there anything in particular that is different about scale. The VectorEqual() function detects differences in position and rotation perfectly (to 0.001), but not scale. Why is that?
I've even noticed that when using the api's AutoKey() function (which worked in R10) that it would set scale keys when only the rotation changed. Something seems amiss there. :o(
Any clues?
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/11/2008 at 08:45, xxxxxxxx wrote:
Howdy,
Any idea on the scale issue?
Also I have another question regarding Undo. I've added:
>
\> doc->AddUndo(UNDO_NEW,track); \>
after inserting the track and then added:
>
\> doc->AddUndo(UNDO_CHANGE,track); \>
before setting a key value.
Is this the correct way to handle the undo? I can't tell for sure from the SDK documentation. I'm assuming that since the track is "inserted" the undo should come after with an "UNDO_NEW", but I'm not sure about the key whether the undo should be on the key itself with "UNDO_NEW" or if it should be on the track with "UNDO_CHANGE".
It seems to work OK (not crashing) the way I have it, but I just want to double check to make sure it's correct. ;o)
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/11/2008 at 04:04, xxxxxxxx wrote:
Sorry, I can not confirm the scale problem, this is working fine here using your description example. Maybe there is something wrong in your code creating the cloned container?
As for the undo handling, you call UNDO_NEW after allocating and inserting. You call UNDO_CHANGE before you do any change.
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/11/2008 at 05:12, xxxxxxxx wrote:
Howdy,
> Quote: Originally posted by Matthias Bober on 03 November 2008
>
> * * *
>
> Sorry, I can not confirm the scale problem, this is working fine here using your description example. Maybe there is something wrong in your code creating the cloned container?
>
>
> * * *This is the thing that is puzzling me because the code is the same for creating the position and rotation cloned containers. I'll have to investigate elsewhere. :o(
> Quote: Originally posted by Matthias Bober on 03 November 2008
>
> * * *
>
> As for the undo handling, you call UNDO_NEW after allocating and inserting. You call UNDO_CHANGE before you do any change.
>
>
> * * *Right. That's what I got from the SDK Documentation, I just wanted to confirm if my assumption that adding a key to a track was considered a "change" to the track. Is my assumption correct?
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/11/2008 at 05:29, xxxxxxxx wrote:
You should use UNDO_NEW on the things you insert. So if you inserting keys you should use the pointer to the key in AddUndo().
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/11/2008 at 05:54, xxxxxxxx wrote:
Howdy,
OK, so are you saying that this is wrong:
>
\> doc->AddUndo(UNDO_CHANGE,trackX); \> CKey \*keyX = trackX->GetCurve()->AddKey(time); if (!keyX) return FALSE; \> keyX->SetValue(trackX->GetCurve(),value.x); \>
... and it should be like this?:
>
\> CKey \*keyX = trackX->GetCurve()->AddKey(time); if (!keyX) return FALSE; \> keyX->SetValue(trackX->GetCurve(),value.x); \> doc->AddUndo(UNDO_NEW, keyX); \>
The confusing part for me is that it's adding a new key, but the function name to add the key doesn't have the word "Insert" in it. So my assumption was since it wasn't an "Insert" or an "Alloc" function, then use the first example with UNDO_CHANGE.
Sorry, but sometimes my obsessive compulsiveness surfaces and causes these little problems of comprehension. :oD
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/11/2008 at 06:03, xxxxxxxx wrote:
As soon as you are creating an object and insert it into something you have to use this object with AddUndo() and UNDO_NEW. I agree it can be a bit confusing sometimes. But if you think about it the AddKey() function is doing exactly this, allocating and inserting keys
So yes this would be the correct one:
>
\> Key \*keyX = trackX->GetCurve()->AddKey(time); if (!keyX) return FALSE; \> doc->AddUndo(UNDO_NEW, keyX); \> keyX->SetValue(trackX->GetCurve(),value.x); \>
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/11/2008 at 06:05, xxxxxxxx wrote:
Howdy,
OK, thanks. ;o)
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/11/2008 at 07:14, xxxxxxxx wrote:
Howdy,
Well, upon further investigation I found the scale problem elsewhere in my code.
Yee-Ha! Now my tag has it's own AutoKey() function working perfectly in R9.6, R10 and R11!
Thanks, Matthias, for all your help and patience.
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/03/2009 at 09:51, xxxxxxxx wrote:
Hi Dan,
For your information, it turned out that AutoKey works for Tbaselist4D types only. Tags are of Tbaselist2d type. This should be fixed in a future update of Cinema.
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/03/2009 at 10:06, xxxxxxxx wrote:
Howdy,
Thanks.
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/10/2009 at 03:33, xxxxxxxx wrote:
FYI, this is fixed in CINEMA 4D R11.5.
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/10/2009 at 07:13, xxxxxxxx wrote:
Howdy,
Thanks Matthias. ;o)
Adios,
Cactus Dan