-
-
Notifications
You must be signed in to change notification settings - Fork 156
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 #426
Three json #426
Conversation
Addding a Skeleton.toJSON
JSON data for BufferAttribute
@Methuselah96 What do you think of the progress so far? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall, thanks for working on this.
…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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hoodgail Thanks for your work on this! I went ahead and did some cleanup of some of the changes, hopefully while preserving the intent of your changes. Let me know if I messed anything up and feel free to keep building on this with more PRs, I just figured this would be a good place to get some of it merged.
Thank you |
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
* 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>
@Hoodgail I traced this PR as the source of the Since fromArray(array: QuaternionTuple, offset?: number): this; it produces an error when provided an array that doesn't strictly have 4 elements, which is expected when passing an Is there a reason |
@mattrossman It looks like this was an oversight on my part. I had completely forgot about the offset argument It should follow the same way its written in Vector3 at
Will you make a pull request? or should i? My apologies ! |
Updates the Quaternion overloads for fromArray and toArray to align with Vector3's implementation as discussed here: three-types#426 (comment)
* fix: Quaternion fromArray and toArray signatures Updates the Quaternion overloads for fromArray and toArray to align with Vector3's implementation as discussed here: #426 (comment) * fix: Return number[] for number[] input
Object3D
FogBase
Math
(Core)
Texture
Source
BufferGeometry
BufferAttribute
KeyframeTrack
Finalization