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 ObjectLoader.d.ts #400

Closed
wants to merge 3 commits into from
Closed

Conversation

Hoodgail
Copy link
Contributor

Accept Records instead of Arrays, Missing argument in ObjectLoader.parseObject

Why#399

If you look at ObjectLoader.parseObject#L683

parseObject( data, geometries, materials, textures, animations ) {

You'll notice that they're accepting textures as an argument before animations

I you look at getGeometry you'll notice that the geometries is expected to be an object/record

I you look at getMaterial you'll notice that the materials is expected to be an object/record

Same goes for getTexture which was missing in the arguments in ObjectLoader.d.ts

Those arguments are then passed to parseImages, parseAnimations, parseMaterials, .parseGeometries etc...

Ref: .parseImages#L363

Accept Records instead of Arrays
.parseMaterials returns a record of materials, not an array
Remove inaccurate comments.
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 for the PR! Looks like there's a failing test and left a comment regarding something that doesn't seem to match with source in my first read through.

parseAnimations(json: Record<string, any>): Record<string, AnimationClip>;
parseImages(json: Record<string, any>, onLoad?: () => void): { [key: string]: Source };
parseImagesAsync(json: Record<string, any>): Promise<{ [key: string]: Source }>;
parseTextures(json: Record<string, any>, images: any): Record<string, Texture>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just spot-checking this against source, it seems like json is treated as an array here.

@Methuselah96
Copy link
Contributor

I believe these changes are now redundant after #535 and #570.

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