UInstancedStaticMesh
has a member function UpdateInstances
:
/**
* Lightweight interface to add, remove and update instances.
*
* @param AddInstanceTransforms: The transforms of the new instances to add.
* @param RemoveInstanceIds: The ids of the instances to remove.
* @param UpdateInstanceIds: The ids of the new instances to update.
* @param UpdateInstanceTransforms: The transforms of the new instances to update.
* @param UpdateInstancePreviousTransforms: The transforms of the new instances to update.
* @return True on success
*/
virtual bool UpdateInstances(
const TArray<int32>& UpdateInstanceIds,
const TArray<FTransform>& UpdateInstanceTransforms,
const TArray<FTransform>& UpdateInstancePreviousTransforms,
int32 NumCustomFloats,
const TArray<float>& CustomFloatData);
As you can see the documentation is incorrect:
-
There is no parameter
AddInstanceTransforms
-
There is no parameter
RemoveInstanceIds
-
The documentation of both
UpdateInstanceTransforms
andUpdateInstancePreviousTransforms
says “The transforms of the new instances to update”. (Does it really want the same identical argument to both parameters? I doubt it.) -
The parameters
NumCustomFloats
andCustomFloatData
are undocumented.
Does anyone know what the actual semantics of this function and its parameters are? In particular:
-
What is
UpdateInstancePreviousTransforms
? Previous to what? Previous to this call? So the caller needs to keep the old transforms? -
What should the length of each vector be relative to each other and the other parameters?
-
How do you use the function to add instances? How do you use it to remove them? What are the instance ids?