I am currently working on a project with a character that has about 10-20 different clothing accessory that can be cycled through. Only 1 is shown at a time.
They are all sharing an armature and each have an armature modifier.
Initially I set it up so my script would just “.visible = True/False” on each item to hide and show them.
However I found that performance began to suffer as I added more clothes. I assume the Armature modifier is still processing the meshes in the background and after testing this theory with a really dense mesh I think this was correct.
despite the mesh being set to .visible = False the project was super slow
So I tried Suspending the collections using the Collection Actuator. but the result is the same. Despite the mesh not being on screen and even the collection being “Suspended” the meshes armature modifier is still being processes.
It’s not as bad as if the mesh is visible but there is still a measurable impact to the frame rate.
Does anyone know the solution to this, how would I go about truly “Disabling” an asset when needed?
Here’s a snippet of the code, really the main part of interest will be right at the end. “scene.objects[str(currentassetname)].visible = True”
def CycleAsset(direction, assetlist): assetlistlen = len(assetlist) #Set all assets in the list to invisible for asset in assetlist: scene.objects[str(asset)].visible = False #direction controlas next asset or previous asset bl.AccessoryIteration += direction #loop if end or begining of list if bl.AccessoryIteration > assetlistlen -1: bl.AccessoryIteration = 0 elif bl.AccessoryIteration < 0: bl.AccessoryIteration = assetlistlen -1 #get asset and make invisible currentassetname = assetlist[bl.AccessoryIteration] scene.objects[str(currentassetname)].visible = True