Digital Art Zone

 
     
SetGlobalTransform3D problem
Posted: 11 August 2012 12:23 PM   [ Ignore ]
Member
Avatar
Rank
Total Posts:  81
Joined  2006-06-18

Writing a plugin behavior, (Apply() method of a modifier) I’m having trouble with setting the transform:

TTransform3D tr tree->GetGlobalTransform3D(kCurrentFrame);
  
tr.fTranslation.newZ;
  
tree->SetGlobalTransform3D(tr); 

This code should only move the object up or down, right? But when I use it on an object whose hotpoint is not at object center, then the object moves a bit in X and Y every time I adjust the camera’s position. (Which has nothing to do with the object that has the modifier, but does force the modifier to recalculate.)

I found an old topic by DCG Eric that seems to mention a similar problem, but there was no reply:
old forum topic

What am I doing wrong??

Profile
 
 
Posted: 12 August 2012 10:12 AM   [ Ignore ]   [ # 1 ]
Member
Avatar
Rank
Total Posts:  32
Joined  2005-09-14

Hi Brian,

Sadly I do not remember the context of the question, but I dug around the Carrara SDK yahoo group and found Arnaud’s reply.

We did a lot of changes with transforms in C6. TTreeTransform now has
two different modes (content figures use the new one).

To set global transforms, we recommend calling
SetGlobalTreeTransform2 (it uses the new TGlobalTreeTransform class).

Arnaud.

As I look in my code however, I do not appear to be following his advice. I do not use SetGlobalTreeTransform2 anywhere and I seem to still be using SetGlobalTransform3D quite a bit.

Good luck,

 Signature 

Eric Winemiller
Digital Carvers Guild
Plug-ins for Carrara and LightWave

Profile
 
 
Posted: 12 August 2012 03:36 PM   [ Ignore ]   [ # 2 ]
Member
Avatar
Rank
Total Posts:  81
Joined  2006-06-18

So, in other words, we’re supposed to use the function that says “NOTE: this function should be avoided as much as possible as it cannot work in some cases” in the SDK?

lol

Profile