Zooming on object or scene invalidates object cache?



  • Hi,

    In my generator object, I do the same that probably everyone does:

    BaseObject* MyObject::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh)
    {
    	Bool isDirty = op->CheckCache(hh);
    	if (!isDirty)
    		return op->GetCache(hh);
    
    	// ...and more code.
    }
    

    This works just fine, as it has been for years.

    Just now I noticed that op->CheckCache(hh) returns true when I use the "O" key (Frame Selected Objects) or the "H" key (Frame Geometry). This always happens, whether my object is currently selected in the Object Manager or not.

    Why? And is there a way to avoid this? I don't see any need to rebuild my object's cache, just because the user zooms on any object in the scene.

    Thanks in advance for any info!

    Cheers,
    Frank



  • hi,

    The command need to calculate an overview of all objects. During this process, it's calling a function to calculate the caches of all object in the scene.
    This function is there since 2014 at least so i guess nothing have change here.

    We think this could also be useful if you have objects with LOD.

    Looking at how the code is running, there is no way to avoid this with that command. It's really running into every objects in the scene, delete the bit BIT_CONTROLOBJECT and rebuild the cache.

    Cheers,
    Manuel



  • Scary 🥶

    If the objects are already being displayed in the viewport, I don't see why their caches should be rebuilt, just to zoom on the objects (especially when using "O" to zoom on just one single object).

    Also, properly programmed generator objects should return their bounding box in BaseObject::GetRad() and BaseObject::GetMp(). As far as I see the zooming behavior with "O", only the bounding box is used anyway, so the cache shouldn't even be required for this.

    That's a pity.

    But thanks for the answer!

    Cheers,
    Frank


Log in to reply