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

GLTFExporter: Added onlyVisible option #12028

Merged
merged 1 commit into from
Aug 23, 2017
Merged

Conversation

fernandojsg
Copy link
Collaborator

I forgot to include this changes in a previous PR 👼


children.push( processNode( child ) );
if ( !options.onlyVisible || child.visible ) {
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe this is easier to read?

if ( child.visible || options.onlyVisible === false ) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

@mrdoob
Copy link
Owner

mrdoob commented Aug 23, 2017

Actually. What's the use case for exporting invisible objects?

@fernandojsg
Copy link
Collaborator Author

@mrdoob sometimes you would like to export all the meshes on the scene even if they're hidden, for example you could have an editor where you hide the background to focus on few objects and you don't want to toggle visibility of everything just to export, similar to how 3dsmax or similar works.

@fernandojsg
Copy link
Collaborator Author

but I agree that won't be the most common use case, that's why onlyVisible is set to true by default

@mrdoob
Copy link
Owner

mrdoob commented Aug 23, 2017

Wouldn't it be cleaner to use object.layers for that?

@mrdoob
Copy link
Owner

mrdoob commented Aug 23, 2017

Or even another scene. In https://threejs.org/editor/ I use another scene for the helpers.

@fernandojsg
Copy link
Collaborator Author

Layers could be another use case yep, but I still feel using just visible for an object could be useful. In aframe-inspector we allow the users to toggle the visibility on the sidebar:
image
If you're moving things around maybe you want to hide big objects that prevent you to work on the ones you want to focus so you just toggle few of them, but you still want to export the whole scene, and don't want to deal with layers and so on, as it's just part of your creation workflow but you won't use that visibility options on your final scene.
In the inspector I also use a different scene just for the helpers so it won't conflict with this option either.

@mrdoob
Copy link
Owner

mrdoob commented Aug 23, 2017

I see I see 👌

@mrdoob mrdoob merged commit 1ab1bb2 into mrdoob:dev Aug 23, 2017
@mrdoob
Copy link
Owner

mrdoob commented Aug 23, 2017

Thanks!

@fernandojsg
Copy link
Collaborator Author

thanks! ;)

@fernandojsg fernandojsg deleted the visible branch August 23, 2017 21:16
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