Hiding Objects with a Pro Account, not Premium

(Nuaire) #1

Hi there,

I run a Pro Sketchfab account for my company but need to find out something.
The model below (not mine) has objects appearing and hiding at certain points in the animations.
As far as I can find out the only way to have control over hiding objects (other than scaling them in and out of view which isn’t suitable for me) is by using the API javascript editor.

The account below only seems to have a Pro account (as per their tag label) (just like my company’s account) but the API option only seems to be available for the Premium accounts.

Can anyone help? I have zero javascript knowledge but could really do with being able to hide parts of my mode…

(Shaderbytes) #2

hide/show works from a pro account , i can testify to that…

(Nuaire) #3

Hi shaderbytes,

Is hide/show a standard feature or an API option? I wasn’t aware I could use the API features at all.


The Viewer API is available to all users. You need a Premium account to use the Viewer API for commercial purposes:


(Shaderbytes) #5

Also take note you cannot use the api to affect models on the sketchfab domain itself, only on external embeds of the model…eg on another domain where you can upload javascript to control your model. There is no “javascript editor” you need to write the javascript yourself, or hire someone to do it for you since you mentioned you have zero skills in this department.

(Nuaire) #6

Thanks for the replies although this confuses me further. How has the user above managed to show and hide their model parts during their animation then? This is how it shows within this domain. Not an embedded version.

(Shaderbytes) #7

simple …if it is on this domain it some sort of animation. There is No API availability on this domain , none, what so ever! So no user can ever use anything from the API here so no need for confusion. Once you eliminate the known variables then what is left must be the truth. This is why it is easy for me to conclude it is an animation of sorts, because i know it cant be the viewer API :wink:

(Nuaire) #8

I completely understand it’s not an API intervention I was just wondering if anyone new a way to do it like they have in th view above. I have tried in the past to scale items down to virtually zero across a single frame but Sketchfab doesn’t seem to work with frames and it still bridges the gap and you can see the model part being scaled down quickly not just turning off.

The parts in the model above turn off and on instantaneously and I can’t figure out how it’s done. Was hoping someone could shed some light on how it IS done rather than how it isn’t.


It should be possible to make objects disappear in a single frame using scale 0.

(Nuaire) #10

Yes it is possible and is something I’ve tried before but Sketchfab bridges the gap between the two frames and you can still make out the object being scaled down (see the test model I made below, you can see the teapot scaling down in to the box. This happens across a single frame in 3DS Max. This is not what is happening with the Systemair wall fan model above. The parts are simply switching off and on with no scaling or movement.
Has anyone got any idea how they did this outside of API scripting?

(Shaderbytes) #11

Sketchfab has had this issue for as long as i can remember , take note even in your software app , there is actually interpolation between two adjacent frames as well … it is just so fast that by the next visual display (frame) all the interpolation has already occurred so you dont see it , but it did still happen :wink: Sketchfab has always had this issue… it calculates its own frames and does not respect the notion of adjacent frames from the app and so interpolation that is not supposed to be visible becomes visible.

As for the scene above they probably used a very fast frame rate ??. I cant vouch for models exported from different apps , whether sketchfab import all the same , they probably dont. But this adjacent frames thing has always been an issue across models from different apps… lets hope one day sketchfab sorts this out properly… no more visual frames of interpolation for adjacent frames in the modeling app

here is an example : Not perfect but it can pass. I think keeping the origin during this operation is essential , the original model you shared above is doing that , by your example you did not , This translation just shows the glitch better. It is not as obvious when the model scales without translation.

(Shaderbytes) #12

I tried various export sampling rates , different frame rates, different length of animation , nothing help really. I dont know how the first example disappears so quickly without visual interpolation… i can only think it must be the fact that the animation is rather long. If i switch my animation to view frames , I have one frame of interpolation now, for example 36 is scale 1 , 38 is scale 0 , so im sure 37 is 0.5…? I could not get is to have zero frames of interpolation.


@waleguene do you have any advice about this? i remember we talked about it before

(Waleguene) #14

The topic is a bit tricky so let’s do a quick recap how it works and what can be done to get an instant animation transition.

Under the hood, Sketchfab engine supports only linear interpolation, so if we want constant/step keyframes (sharp animation), we need to trick.

During the processing, all animations are baked with a constant and defined framerate. The reason is that file formats and softwares have dozens of features/modifiers that can alter the animation of a given object, in addition to it’s own keyframes. Baking everything into a new animation track allows to take into account as much features has possible. The problem is that we will always have the same distance between two keyframes, that will lead to smooth interpolation.

Workaround for step/constant keyframe / sharp animation
For both glTF and FBX file format, when a constant/stepped keyframe is detected, we bake two keyframes with a very small interval between them in order to recreate the sharp animation transition.
In order to get this working, the keyframes inside the file must be explicitely declared as constant (FBX) or STEP (glTF).
This workaround works well as soon as the data is inside the file.

In some cases, the software doesn’t export this data on the keyframes into FBX files (I need to check but I think it’s not exported from Blender).

The case of Blender

(@shaderbytes you probably know Blender much better than me so don’t hesitate to comment if I missed something)

The tricky part with Blender is that it plays animation frame by frame, so whatever the type of the keyframe, you will always have a sharp animation between two successive frames. On Sketchfab, if you use the exact same data, you will have an animation between the two successive keyframes, defined by the interpolation between them.

If you want to reproduce the same behaviour on Sketchfab, just clik on the time in the timeline to switch play mode to ‘frame by frame’. You should have sharp transitions now.

At the moment, there is no workaround to support this for .blend files.

(Shaderbytes) #15

blender animation is actually a collection of curves, frames are just start/end points of these curves. The default interpolation is smooth bezier, you have to manually stipulate if you want linear/constant interpolation.even if two frames are adjacent to each other, they still represent the start and end of a curve.

I just tried to change the interpolation in blender to constant , it indeed does not help so the data is probably not exported, as the OP is using MAX maybe if they set their interpolation in there it will work.

blender screenshot showing curve is constant, but one frame of interpolation still is visible so blender is never going to work unless they export this data :

(Nuaire) #16

I’ve sorted it!
In the end I contacted the user who made the fan animations and he confirmed that it is simply a case of using the visibility track in 3DS Max. The FBX format exports this and Sketchfab likes it too. Easy peasey lemon squeezey.
What doesn’t work is any gradual fading in or out. It’s either 100% opaque or 100% transparent.

Here’s my test run. I set it to disappear within one frame but gradually reappear over around 20 frames. The gradual reappearing gets ignored and it turns fully opaque once the visibility value is anything above zero. It doesn’t wait until the value is 1.