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

Update Material type definitions: Add MaterialJSON format #1072

Merged
merged 9 commits into from
Jul 18, 2024

Conversation

Hoodgail
Copy link
Contributor

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

Hoodgail and others added 9 commits July 17, 2024 18:08
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
…simple types. Use 'Array<T>' instead @typescript-eslint/array-type
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
…e types. Use 'Array<T>' instead @typescript-eslint/array-type
Copy link
Contributor

@Methuselah96 Methuselah96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Methuselah96 Methuselah96 merged commit 12a22f8 into three-types:master Jul 18, 2024
4 checks passed
@Hoodgail Hoodgail deleted the material-json branch July 18, 2024 13:59
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