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

Add feature to blender exporter to embed textures in .json file #8068

Merged
merged 2 commits into from
Feb 14, 2016
Merged

Add feature to blender exporter to embed textures in .json file #8068

merged 2 commits into from
Feb 14, 2016

Conversation

mhirsch
Copy link

@mhirsch mhirsch commented Feb 4, 2016

This PR adds a feature to the blender exporter to embed textures in the .json file as base64 strings, much like three.js editor. I find this pretty useful when using the three.js editor from disk or from the web, since the texture paths from the .json file will usually not be correct relative to the three.js editor root.

The patch uses the native base64 library in python to do the encoding, and disables the copy_textures option when selected, to avoid the confusing situation of copying texture image files without using them.

@mrdoob
Copy link
Owner

mrdoob commented Feb 7, 2016

Maybe "Copy Textures" could be renamed to "Export Textures". "Embed Textures" would then rely on the previous checkbox to be checked.

How does that sound?

@mhirsch
Copy link
Author

mhirsch commented Feb 8, 2016

Just so I'm clear -- there would be two options: export textures and embed textures? Clicking export textures would copy the textures to the model export directory and embed textures would base64 encode them in the json file? When embed textures is checked, export textures must also be checked?

If you think the above is more intuitive for users I'm happy to re-submit the patch with that behavior.

@mrdoob
Copy link
Owner

mrdoob commented Feb 8, 2016

Is there a way to make the "Embed" checkbox clickable only if "Export Textures" is clicked?

@mhirsch
Copy link
Author

mhirsch commented Feb 8, 2016

I see -- sure, I'll submit a new PR.

@mrdoob
Copy link
Owner

mrdoob commented Feb 8, 2016

Thanks!

@mhirsch
Copy link
Author

mhirsch commented Feb 13, 2016

@mrdoob I thought I'd ping you again, in case you didn't see this. Do you think this PR is ready to merge?

@mrdoob
Copy link
Owner

mrdoob commented Feb 14, 2016

Thanks for pinging! I would have missed this otherwise. Looks good now!

mrdoob added a commit that referenced this pull request Feb 14, 2016
…ption

Add feature to blender exporter to embed textures in .json file
@mrdoob mrdoob merged commit 6cf33a6 into mrdoob:dev Feb 14, 2016
@mhirsch
Copy link
Author

mhirsch commented Feb 14, 2016

Thanks!

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