Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / Writing custom transformation control
  RSS 2.0 ATOM  

Writing custom transformation control
Rate this thread
 
37784
 
Permlink of this thread  
avatar
  • _Dementor
  • Posted: 15 December 2009 01:18 AM
  • Total Posts: 1
  • Joined: 15 December 2009 08:04 AM

I waste to lot of time, whitout any result, so i hope so somebody could help me.
I would like to override the default transformation control function. For example:
when I rotate something(e.g. Box), then do something (e.g. move anoter box) and of course execute the original rotate.
The problem starting with, to set the original transfomation.
I have got 2 possible result:
1. my ovverrided SetValue function, recursive calling selves.
2. the original transformation not set.
Here is my code:

class MyControl : public Control
{
private:
INode* m_Node;

public:
MyControl(INode* node) { m_Node = node; }

void SetValue(TimeValue t, void *val, int commit=1, GetSetMethod method=CTRL_ABSOLUTE) {
//.... getting the transformation of val and doing something (nothing intresting)

//when try setting the node transformation, then calling this function again (recursive)
Matrix tm; //… set of val
m_Node->SetNodeTM(t, tm) //not set, just called SetValue again…
}

.... //other implements (nothing intresting)
};

....
//using…
node->SetTMController(new MyControl(node)) //where the node is existing node (evrithing is fine)

When e.g. rotate above node (in 3ds max), then calling MyControl::SetValue. I can debug this with Visual Studio.

I had tried every possible solution.
I think, I must ovverride the CommitValue, and RestoreValue functions to, but I don’t know how using them.

Sorry for my poor english. :-D



Replies: 0