3DViewerAnimation
Purpose
The 3DViewerAnimation collection defines the configuration of 3D animations linked to a catalog.
Its purpose is to store the animation templates, their names, state, and related catalog reference.
It also contains the Variant subcollection, which provides detailed step-by-step configurations of the 3D animation.
Document schema
{
"TamplateName": "string",
"animationName": "string",
"catalogRef": "string",
"state": "string",
"title": "string"
}
Subcollection: Variant
The Variant subcollection stores specific 3D model animation data, including model URL and step-based animation parameters.
Document schema
{
"modelUrl": "string",
"steps": [
{
"cameraOrbit": "string",
"cameraTarget": "string",
"content": "string",
"dataPosition": "string",
"fieldOfView": "string",
"id": "string"
}
]
}
Indexes
- catalogRef is a
stringthat refers to the ID ofCataloguescollection.
Query examples
// Fetch the Reference Doc from Firebase
const animationRef = doc(db, "3DViewerAnimation", animationId);
// Get the Document Snapshot from the Reference Doc
const animationSnap = await getDoc(animationRef);
// Query animations by catalog
const animationsByCatalog = query(
collection(db, "3DViewerAnimation"),
where("catalogRef", "==", catalogueId)
);
// Fetch the Document from Variant subcollection
const variantDocRef = await getDoc(
doc(collection(db, "3DViewerAnimation", animationId, "Variant"), variantId)
);
// Fetch all steps of a variant
const variantSnap = await getDocs(variantRef);