Start IPR rendering in the viewport
-
I register a VideoPostPlugin as a renderer.Now I can render an image to viewport or picture viewer in c4d with my own renderer plugin.
How can I get the message that the scene changed so I can update the render view with new scene data and display in the viewport of c4d ,just like Redshift Start IPR ,using c++.
Many Thanks! -
Hello @freeze,
thank you for reaching out to us. Scene changes are communicated as the core message
EVMSG_CHANGE
, such messages can be received in theCoreMessage
methods of aGeDialog
(and derived types) orMessageData
instance.There is however no data which would inform you what has changed. You are expected to track that yourself. See How to detect a new light and pram change? for one of the cases where we discussed tracking scene changes. The case is for Python which is more or less analogous to C++. They main difference in C++ is that you can use GeMarker directly and do not have to go over
MAXON_CREATOR_ID
(which is just the data of theGeMarker
of the node).Cheers,
Ferdinand -
Hello @ferdinand ,
I have created a Message method as:Bool SmarayPlugin::Message(GeListNode* node, Int32 type, void* data) { BaseList2D* const item = static_cast<BaseList2D*>(node); if (!item) return false; BaseContainer* renderdata = item->GetDataInstance(); switch (type) { case MSG_DESCRIPTION_COMMAND: { DescriptionCommand* dc = static_cast< DescriptionCommand*>(data); if (dc->_descId[0].id == AOV_MANAGER_BUTTON) { if (aov_dialog) { aov_dialog->Close(); DeleteObj(aov_dialog); } aov_dialog = NewObjClear(UISmarayAOVManager, renderdata); if (aov_dialog) { aov_dialog->Open(DLG_TYPE::ASYNC, 800, 800, 800, 600); } } break; } default: break; } return VideoPostData::Message(node, type, data); }
I use it to get the button clicked event to create dialog for setting the AOVs and I find that it may get different type of Message .So can I just check if it is EVMSG_CHANGE and go through my own logic here?
-
Hey @freeze,
no, that would not be correct. This is a
NodeData::Message
method you are showing us here which hooks into the message stream sent to a node, not the core message stream. As already explained above, you will need theCoreMessage
method of aGeDialog
(or derived types) orMessageData
instance to receive core messages. I also posted a link to (Python) example code above.There is no dedicated manual for the message system in C++, but we have a small one for the Python API.
Cheers,
Ferdinand