Edit object in BaseDocument
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/11/2008 at 11:45, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11
Platform:
Language(s) : C++ ;---------
Hi!I have a beginner question. I have an object in a document and want to change its position in a ToolData::MouseInput.
> <code>
> Bool MyToolData::MouseInput(BaseDocument *doc, BaseContainer &data;, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg;)
> {
> GetActiveDocument()->GetFirstObject()->SetPos(Vector(100));
> return TRUE;
> }</code>Currently the objects position is not updated in the editr until I clicked on the object. I guess I have to update the object or document. I tried MSG_UPDATE or MSG_CHANGE which did not work.
Which Message needs to be sent (object? document?) ?
Thanks a lot.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/11/2008 at 20:51, xxxxxxxx wrote:
This might work (and a little more error checking)
BaseDocument* doc = GetActiveDocument();
if (!doc) return FALSE;
BaseObject* obj = doc->GetFirstObject();
if (!obj) return FALSE;
obj->SetPos(Vector(100.0f));
obj->Message(MSG_UPDATE);
// For asynchronous AM update while in Mouse loop
GeSyncMessage(EVMSG_ASYNCEDITORMOVE);
// Update display to show drag results
DrawViews(DA_ONLY_ACTIVE_VIEW|DA_NO_THREAD|DA_NO_ANIMATION);
return TRUE; -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/11/2008 at 01:53, xxxxxxxx wrote:
Thank you Works perfect