Object doesn't update its cache bit
-
On 21/05/2018 at 06:04, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18
Platform:
Language(s) :---------
Hello.I have a plane which has a bend deformer as child.
The deformer's strength parameter is animated.
The problem is that whenever I move the timeline track bar forward and backward, the plane is deformed in the viewport, but I don't receive a cache update for it.
Only the deformer's cache is updated.
Shouldn't the plane have its cache bit updated ?Thank you for your time.
-
On 22/05/2018 at 06:49, xxxxxxxx wrote:
Hi Peterakos, thanks for writing us.
With regard to your post, I confirm that the reported behavior is indeed correct since the bend deformer (or any other deformer) isn't actually changing the topology of the underlying geometry (the plane). Instead updating any of the parameters related to the plane generation would force a object geometry refresh causing the the dirtiness of the DIRTYFLAGS_CACHE to change (actually to increase). This is actually the reason why in Cinema deform-cache is distinct from cache and should be accessed respectively with BaseObject::GetDeformCache() and BaseObject::GetCache().
Best, Riccardo
-
On 23/05/2018 at 23:32, xxxxxxxx wrote:
Hello and thank you very much for your help !
As the manual says "the deformer will affect its parent object and the hierarchy below that parent".
So, every time a deformer's cache is updated I can set the parent's cache bit dirty. How can I know if an object is deformer ? (other than comparing the object Id with Obend, Otwist, e.t.c.)Thank you for your time !
-
On 24/05/2018 at 02:00, xxxxxxxx wrote:
Hi Peterakos,thanks for following up.
Checking if an item is a modifier can be accomplished by using GeListNode::GetInfo() and using a bitwise "and" operator with OBJECT_MODIFIER flag:
if (myObject && myObject->GetInfo() & OBJECT_MODIFIER) { // do something here: the object is a modifier since it was registered with the OBJECT_MODIFIER flag ... }
That said it could worth having a look at the BaseObject Manual in the Flags section.
Best, Riccardo