Hide specific annotations


(Any Dev) #1


is it possible to hide (alpha=0, visible=false, opacity=0) specific annotations?

api.getAnnotationList( function( err, annotations ) {

for ( var i = 0; i < annotations.length; i++ ) {

    var annotation = annotations[ i ];

    if ( annotation.name === 'TEST' ) {

        annotation.visible = false;

    } else {

        annotation.visible = true;



} );

I don´t want to hide all annotations... Just a few.



Not at the moment, but it's an interesting idea. Could you give us a bit more context and use-case information?

Could you not hide and show all annotations as necessary as they are focussed / blurred?

(Any Dev) #3

Let´s say i click on an annotation: all of the displayed annotations will be hide and a new group of annotations show up.
This could be very useful to show more detailed informations for specific areas when the cam zoomed in.

(Tboneous Maximus) #4

!!! HELP !!!

All I need is a function like leaveAnnotation() or resetAnnotations() so I can trigger external buttons to goto specific or stop current focused annotation.


Sorry, I'm not sure I understand the use-case.

You can gotoAnnotation(), and there's an event annotationBlur when you leave an annotation. We don't have a function to "go to no annotation" yet, but it's something we want to add.

(4 D Research Lab) #6

@james I’m digging this one up from the archives hoping the refresh interest in this feature. I would really like to be able to hide and show specific annotations, relating to specific parts of the model that can be turned on and off. Example: http://www.4dresearchlab.nl/sketchfab/4.htm As for now, all annotations are always visible, even if the mesh they are supposed to annotate is not, resulting in some floating annotations.

Just for your information, the final application would be used to present archaeological models, and as we go about in archaeology, we often do not know things for sure, so it is important to visualise various alternative hypothetical reconstructions of an archaeological site for instance.


Understood, thanks for the example!

(Klaasnienhuis) #8

@4DResearchLab with the new method https://sketchfab.com/developers/viewer/functions#api-getWorldToScreenCoordinates you could build your own annotations in the frontend separately from sketchfab. This gives you more control to show/hide annotations

(4 D Research Lab) #9

@klaasnienhuis Smart. I’m going to try that. Thanks!