Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hello,
The following line of code is supposed returning True only if parameters of the object changed? But why it also returning True when my object selected and I Move / Scale / Zoom / rotate the perspective view.
# dirty = True if a cache is dirty or if the data (any parameters) of the object changed. dirty = op.CheckCache(hh) or op.IsDirty(c4d.DIRTY_DATA)
Thanks.
Hi @mfersaoui thanks for writing us.
The following line of code is supposed returning True only if parameters of the object changed?
That's partially true: the expression can be True also if the object's cache is dirty
True
But why it also returning True when my object selected and I Move / Scale / Zoom / rotate the perspective view.
That's weird and to answer here you've to show how you're using it with the rest of your ObjectData::GetVirtualObjects() method.
Best, R
Hi,
I am a bit confused about @r_gigante answer, I might be misunderstanding something here.
BaseObject.GetCache will return the hierarchical cache tree for an object or None if neither the object nor its cache children has a cache.
BaseObject.GetCache
None
Since objects (in a pythonic sense) do evaluate as True, your expression will evaluate in 99% of the cases as True. The natural language version of the expression would be: Has the object been touched or has itself or one of its cache children a cache? You are probably missing a not/ negation in your expression.
not
Cheers, zipit
@zipit: I'm a bit confused of your remarks here as well In my answer I see no reference to BaseObject::GetCache() here and looking at the documentation of both methods reported in the initial boolean expression, to answer first @mfersaoui's question, it results to be True if the cache is dirty or any object's parameter has become dirty.
BaseObject::GetCache()
Cheers, R
@r_gigante
jeah, my bad, happens when you write stuff on the train. I was mixing up BaseObject.CheckCache with GetCache.
BaseObject.CheckCache
GetCache
Hi, Thank you @r_gigante, @zipit for your replies.
The problem comes from the GetDDescription funtion because I use some of dynamic parameters on my objects. It is for this reason that op.IsDirty(c4d.DIRTY_DATA) returning True when I Move, Scale, Zoom or Rotate the perspective view.
op.IsDirty(c4d.DIRTY_DATA)