Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three json #1071

Open
wants to merge 76 commits into
base: master
Choose a base branch
from
Open

Three json #1071

wants to merge 76 commits into from

Conversation

Hoodgail
Copy link
Contributor

Minor fixes

Hoodgail and others added 26 commits July 8, 2024 19:23
…cally. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting @definitelytyped/strict-export-declare-modifier
Upgraded the JSON schema for the Object3D hierarchy. This includes updating interface and type definitions to use the new Object3DJSON utility type and extending it to incorporate Object3DRootJSON. This modification will create a more consistent and modular data structure across various objects like OrthographicCamera, PerspectiveCamera, LOD, InstancedMesh, SkinnedMesh, and Mesh. Additionally, this change allows for the inclusion of new fields like "geometries", "materials", and "textures" in the Object3DRootJSON schema.
…afety

Generic types to the KeyframeTrack base class and its derived types (BooleanKeyframeTrack, ColorKeyframeTrack, etc.). The updates involve altering the exported interfaces (KeyframeTrackJSON and KeyframeTrack) to accept and maintain more specific types (boolean, number, string, or array-like), and adjusting the constructors accordingly.
@Hoodgail
Copy link
Contributor Author

@Methuselah96 I made some changes, i'm not sure why it's saying my changes are conflicts, but i will try to use a diff pr branch from now on for when i start working on JSON objects for materials.

Hoodgail added a commit to Hoodgail/three-ts-types that referenced this pull request Jul 17, 2024
Introduces the MaterialJSON format in Three.js, which extends the Material interface. The new format includes serializable properties such as color, roughness, metallic, map, normalMap, and many more. This change enables better JSON parsing and handling of material configurations for Three.js applications.

Confirmed: Types and interfaces have been updated in Object3D.d.ts and Material.d.ts. The Material class has also been updated to include toJSON methods that return MaterialJSON or MaterialJSONRoot objects based on the provided meta data.

Reference(s):
three-types#1071
three-types#1070
three-types#426
Methuselah96 added a commit that referenced this pull request Jul 18, 2024
* Update Material type definitions: Add MaterialJSON format

Introduces the MaterialJSON format in Three.js, which extends the Material interface. The new format includes serializable properties such as color, roughness, metallic, map, normalMap, and many more. This change enables better JSON parsing and handling of material configurations for Three.js applications.

Confirmed: Types and interfaces have been updated in Object3D.d.ts and Material.d.ts. The Material class has also been updated to include toJSON methods that return MaterialJSON or MaterialJSONRoot objects based on the provided meta data.

Reference(s):
#1071
#1070
#426

* Fix: Error:   240:16  error  Array type using 'T[]' is forbidden for non-simple types. Use 'Array<T>' instead  @typescript-eslint/array-type

* ShaderMaterial & Fixes

* Add ShaderMaterialJSON to JSONMeta.materials record

* Fixes
Error:   105:28  error  Array type using 'Array<number>' is forbidden for simple types. Use 'number[]' instead          @typescript-eslint/array-type
Error:   136:19  error  Array type using 'Array<number>' is forbidden for simple types. Use 'number[]' instead          @typescript-eslint/array-type
Error:   157:22  error  Array type using 'Array<number>' is forbidden for simple types. Use 'number[]' instead          @typescript-eslint/array-type
Error:   242:14  error  Array type using 'Array<SourceJSON>' is forbidden for simple types. Use 'SourceJSON[]' instead  @typescript-eslint/array-type

* Error:   240:16  error  Array type using 'T[]' is forbidden for non-simple types. Use 'Array<T>' instead  @typescript-eslint/array-type

* Material

* ShaderMaterial

* Object3D

---------

Co-authored-by: Nathan Bierema <nbierema@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants