WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
254 stars 204 forks source link

[RFC] Catalog & API 3D Model Support #1651

Closed AetherUnbound closed 2 years ago

AetherUnbound commented 2 years ago

3D Models in the Catalog & API

Corollary to WordPress/openverse-frontend#889

This outline is also predicated on the idea that we've identified sources of 3D models, but will seek to flesh out the details regarding metadata fields, database migrations, and API development.

Some potential risks

Some other considerations

Prior work

We may be able to use previous work regarding the addition of audio to the catalog/API as a guide. These updates required a fair amount of generalization, which we may not need to do a second time around.

WordPress/openverse#19

Technical implementation

1. Add 3D models to the catalog

2. Add 3D models to the API

Note: Borrowed heavily from WordPress/openverse#19

3. Add 3D models to the data refresh

Open Questions

Proposed schema

Below is the proposed schema for the model_3d table in the catalog database. It is subject to change based on discussions that happen here and elsewhere.

Many of the fields towards the end are taken from examples on SketchFab (e.g. https://sketchfab.com/3d-models/charmanders-midnight-snack-57866c01da20414ba81885206acbcc85)

Field Type Description
identifier UUID Identifier for the record
created_on timestamp Time the record was created
updated_on timestamp Time the record was updated
ingestion_type varchar What generated the record
provider varchar Provider API that the model comes from
source varchar Source within the provider (e.g. NASA on Flickr), typically the same as provider
foreign_id varchar Identifier that the provider uses for this model
foreign_landing_url varchar URL on the provider that displays the "single-result" page for this model
url varchar URL to the actual asset itself (e.g. the image URL)
thumbnail varchar Thumbnail URL
filesize integer Size of the file
license varchar License for the model
license_version varchar Version of the model's license
creator varchar Creator ID of the model from the provider
creator_url varchar URL to the creator's page on the provider's site
title varchar Title of the model
meta_data jsonb Uncategorized metadata for the model
tags jsonb Tags that describe the model, for use in searching
watermarked bool Whether the model is watermarked - is this needed for 3D models?
last_synced_with_source timestamp Time the record was last updated from the provider
removed_from_source bool Whether the model has been removed from the upstream source
category varchar Category for the model (is this where we'll make the distinction between 3D printers, game assets, etc.?)
filetype varchar File type of the primary file for the model
alt_files jsonb Additional file types for the model
vertices integer Number of vertices within the model
textures integer Number of textures the model uses
materials integer Number of materials the model uses
uv_mapping bool Whether the model contains UV Mapping
vertex_colors bool Whether the model contains vertex colors
pbr bool Whether the model supports physically based rendering
rigged_geometries bool Whether the model supports rigging for animation
animations integer Number of animations the model has
morph_geometries integer Number of morph targets for animation
AetherUnbound commented 2 years ago

Closing in favor of WordPress/openverse#171