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

OBJ/MTL Loaders and Example: add support for chaining #13816

Merged
merged 1 commit into from
Apr 10, 2018

Conversation

WestLangley
Copy link
Collaborator

No description provided.

@WestLangley
Copy link
Collaborator Author

I was not able to figure out how to update the return values for these methods in the docs. Clearly, I am missing something...

@WestLangley
Copy link
Collaborator Author

Can we agree on a consistent pattern to follow in the docs -- or do you not feel it matters?

I am partial to the one I used in this PR, which I have seen used elsewhere in the examples.

new THREE.MTLLoader()
	.setPath( 'models/obj/male02/' )
	.load( 'male02_dds.mtl', function ( materials ) {

		materials.preload();

		new THREE.OBJLoader()
			.setMaterials( materials )
			.setPath( 'models/obj/male02/' )
			.load( 'male02.obj', function ( object ) {

				object.position.y = - 95;
				scene.add( object );

			}, onProgress, onError );

	} );

@donmccurdy
Copy link
Collaborator

donmccurdy commented Apr 10, 2018

I was not able to figure out how to update the return values for these methods in the docs. Clearly, I am missing something...

For example:

<h3>[method:MTLLoader setTexturePath]( [param:String path] )</h3>
screen shot 2018-04-09 at 9 59 25 pm

Maybe method:this would be clearer, and we add this to the blacklist in page.js so it doesn't get a hyperlink, but I don't see that syntax anywhere in the docs currently.

@WestLangley
Copy link
Collaborator Author

Maybe method:this would be clearer

Yes. I think it would be.

@mrdoob mrdoob added this to the r92 milestone Apr 10, 2018
@mrdoob mrdoob merged commit d99be51 into mrdoob:dev Apr 10, 2018
@mrdoob
Copy link
Owner

mrdoob commented Apr 10, 2018

Thanks!

@WestLangley
Copy link
Collaborator Author

Should we ensure that all loaders support the chaining pattern above -- and modify the examples to use it?

@WestLangley WestLangley deleted the dev-mtl_obj branch April 10, 2018 19:38
@mrdoob
Copy link
Owner

mrdoob commented Apr 10, 2018

Yeah. That sounds good to me. Consistency 👌

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.

None yet

3 participants