|
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
|