RTTM Updating
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/04/2004 at 09:00, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.503
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;---------
Howdy,We are trying to force RTTM cache to be rerendered when called for by our function. We have tried to use the Update function but it does not seem to work. Any suggestions?
Regards,
darf - cidertank -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 20/04/2004 at 05:42, xxxxxxxx wrote:
Again, how do we achieve this?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 20/04/2004 at 06:03, xxxxxxxx wrote:
Sorry for keeping you waiting. However, I can't see to reproduce the problem. This code works fine with the scene I tried:
BaseMaterial* mat = doc->GetFirstMaterial(); BaseChannel* chan = mat->GetChannel(CHANNEL_COLOR); PluginShader* shader = chan->GetShader(); if (shader->GetType() == Xcloud) { shader->SetParameter(DescLevel(CLOUDSHADER_SCALEX), ((GeGetTimer() % 100) + 1)/100.0, 0); } shader->Message(MSG_UPDATE); chan->Message(MSG_UPDATE); mat->Message(MSG_UPDATE); mat->Update(TRUE, TRUE); EventAdd();
The texture shown in the editor is updated. Any extraordinary circumstances you can think of?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/05/2004 at 05:29, xxxxxxxx wrote:
I used this code in an expression and it only updates the texture thumbnail ( the RTTM in on the objects the material is applied to never update ). Standard expression, simple as can be. Are you utilizing it as an expression? Can you share the whole source that seems to work for you?
Regards,
darf -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/05/2004 at 06:20, xxxxxxxx wrote:
Normally, when no context is given, any example code I post is simply run in the CommandData::Execute() function of the menu plugin example. Sorry for not being more clear on that.
The TagData::Execute() code is run in a thread. So strictly speaking I'm not sure if the material update calls are allowed. (EventAdd() is of course an even bigger no-no, since it would trigger a new expression evaluation.)
But aside from that, the code above still works for me in the LookAtCamera expression example:enum { CLOUDSHADER_SCALEX = 1002, // REAL CLOUDSHADER_SCALEY = 1003, // REAL CLOUDSHADER_LEVEL = 1004, // REAL CLOUDSHADER_COLOR = 1005, // VECTOR CLOUDSHADER_COMPATIBILITY = 1006 }; LONG LookAtCamera::Execute(PluginTag *tag, BaseDocument *doc, BaseObject *op, BaseThread *bt, LONG priority, LONG flags) { BaseMaterial* mat = doc->GetFirstMaterial(); BaseChannel* chan = mat->GetChannel(CHANNEL_COLOR); PluginShader* shader = chan->GetShader(); if (shader->GetType() == Xcloud) { shader->SetParameter(DescLevel(CLOUDSHADER_SCALEX), ((GeGetTimer() % 100) + 1)/100.0, 0); } shader->Message(MSG_UPDATE); chan->Message(MSG_UPDATE); mat->Message(MSG_UPDATE); mat->Update(TRUE, TRUE); //EventAdd(); return EXECUTION_RESULT_OK; }
I put a material with a cloud shader on a cube and applied the expression. When I rotated the camera the texture shown in the scene changed in realtime (regardless of the OpenGL setting).
I assume that's not what happened in your experiments. Can you think of anything that's different from the above in your code? -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/05/2004 at 06:29, xxxxxxxx wrote:
<I assume that's not what happened in your experiments. Can you think of anything that's different from the above in your code?>
I am not changing any data, just calling the update. It does update correctly in the material manager but not in the view. I assume it has something to do with me not changing a parameter so the cached texture preview doesn't update. Just a theory, will try later.
darf