Is there a way to get a list of animatable properties of a mesh or node or a list of animatable properties to be used in Animation constructor?
Hi F! I will TRY to answer this. It is a very good question.
Scroll down until you see Parameter 4, and we see a list of the allowed “data-types” for animations. ANY property which holds one of those data-types… can be animated. POSSIBLY… Vector4 and Color4 need to be added to that list… but I’m not sure about that.
All in all, the list of animatable properties… for all BJS scene-nodes… would be a BIG list.
The scene-node (mesh, cam, or light) might not display any VISUAL changes when certain properties are animated… but the values in the property are still being animated. An example of an un-noticeable animation… might be: animating the diffuse.b value of a light… from 10 to 20. You would likely see little/no change in the blue-ness of the light, during the animation run. Most people keep their blue-ness levels… between 0.0 and 1.0 inclusive.
Side venture: A little testing playground shows that light.diffuse values, perhaps, have unlimited range. But visual color-saturation wash-out occurs when the values get too large.
Those BJS-gui buttons are setting “discrete” color FLOAT values… setting red, green, blue “channels”, separately. To set all three at the same time, we use a Color3 value… such as:
new BABYLON.Color3(.1, .1, 2.0);
You knew all that already, eh? nod.
Of course, don’t try to animate a property that contains an OBJECT data-type. That could cause troubles.
I hope I have been helpful. Stay tuned for more/better comments, perhaps.
You are right unless it is library defined it is be less direct to have a list of those. Maybe I just start with transformations then late go on to other things.
Thanks a lot. No I did not know all theses before Learning always.
Thanks fo the object data type warning.
Yeah, you could use a “list of most-often-animated scene-item properties”, eh?
We could probably all think-up a pretty decent list… just from our memories. Would that help?
But yeah… the transforms are a nice start… position, rotation, scaling, maybe rotationQuaternion.
Materials… erf… a pretty big list but mostly colors (4-6?), I suppose. Textures… maybe the u/v offsets, angles, wraps, scales… and maybe level. Animating textures… fairly rare, I suppose.
Cameras… all the normal transforms, maybe fov, plus arcCam’s alpha, beta, radius. Animating any targets… will be handled by mesh transforms OF the target mesh, I suppose. But in most target-based cams, .target (and .lockedTarget) can be a vector3, and need-not be a mesh.
On the Scene object… hmm. clearColor and ambientColor, likely. Could be many more… I’d need to do some heavy thinking about animatable Scene-object properties.
BJS GUI items all have a .rotation value… and maybe scaling… but different system than scene-nodes, for sure. .top and .left are hot… though few would ever animate their float-versions. Sometimes they are strings, too ie. “12 px”. Animating a string… could accidentally harm a nearby family pet.
I wish I had a magic way to gather the list. We could run a statistical analysis on all the playgrounds in the playground DB, and glean-out some goods… but… the big dogs don’t loan-out the keys to the DB room… to someone with credentials as feeble as mine.