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

USDZExporter: Add camera support. #24854

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

Vochsel
Copy link
Contributor

@Vochsel Vochsel commented Oct 26, 2022

Description

Adding support for perspective and orthographic cameras added to the scene to be exported.

Discussion

This requires the camera to be explicitly added to the scene to be picked up, useful when there are multiple cameras, but potentially confusing for basic examples, as adding a camera to the scene is not common Three.js practice. Happy to discuss if there is a better way to allow this.

@Vochsel Vochsel marked this pull request as ready for review October 26, 2022 04:53
@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 26, 2022

The change seems to work. I can see the exported camera in XCode:

image

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 26, 2022

This requires the camera to be explicitly added to the scene to be picked up, useful when there are multiple cameras, but potentially confusing for basic examples, as adding a camera to the scene is not common Three.js practice.

GLTFExporter works similar, see:

camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );
camera.position.set( 600, 400, 0 );
camera.name = 'PerspectiveCamera';
scene1.add( camera );

@Mugen87 Mugen87 changed the title USDZExporter: Cameras USDZExporter: Add camera support. Oct 26, 2022
@Mugen87 Mugen87 added this to the r146 milestone Oct 26, 2022
@Vochsel
Copy link
Contributor Author

Vochsel commented Oct 27, 2022

Ah cool, thanks for the context and help on my first ThreeJS PR! @Mugen87

@mrdoob mrdoob merged commit 510f9d2 into mrdoob:dev Oct 27, 2022
hybridherbst added a commit to needle-tools/three.js that referenced this pull request Nov 24, 2022
hybridherbst pushed a commit to needle-tools/three.js that referenced this pull request Mar 28, 2023
lint

minor fix lint extension error

cherry-pick changes done to USDZExporter in the meantime

USDZExporter: Add camera support. (mrdoob#24854)

USDZExporter: Anchoring support (mrdoob#22854)

clean up camera exporting, set default plane to horizontal

USDZExporter: add desktop download button to sample

fix: don't export opacity if model is opaque, leads to incorrect rendering effects

feat: add uv2 support, make sure TextureTransform is only written when needed, use uv2 for occlusion

simplify st / st2 access

USDZExporter: fix exception when trying to process render targets

fix: pass writer into onAfterHierarchy callback, move onAfterHierarchy callback after scene hierarchy write

pass options and extensions correctly
hybridherbst pushed a commit to needle-tools/three.js that referenced this pull request Mar 28, 2023
lint

minor fix lint extension error

cherry-pick changes done to USDZExporter in the meantime

USDZExporter: Add camera support. (mrdoob#24854)

USDZExporter: Anchoring support (mrdoob#22854)

clean up camera exporting, set default plane to horizontal

USDZExporter: add desktop download button to sample

fix: don't export opacity if model is opaque, leads to incorrect rendering effects

feat: add uv2 support, make sure TextureTransform is only written when needed, use uv2 for occlusion

simplify st / st2 access

USDZExporter: fix exception when trying to process render targets

fix: pass writer into onAfterHierarchy callback, move onAfterHierarchy callback after scene hierarchy write

pass options and extensions correctly

Only print usdz in debug mode

# Conflicts:
#	examples/jsm/exporters/USDZExporter.js
hybridherbst pushed a commit to needle-tools/three.js that referenced this pull request Mar 30, 2023
lint

minor fix lint extension error

cherry-pick changes done to USDZExporter in the meantime

USDZExporter: Add camera support. (mrdoob#24854)

USDZExporter: Anchoring support (mrdoob#22854)

clean up camera exporting, set default plane to horizontal

USDZExporter: add desktop download button to sample

fix: don't export opacity if model is opaque, leads to incorrect rendering effects

feat: add uv2 support, make sure TextureTransform is only written when needed, use uv2 for occlusion

simplify st / st2 access

USDZExporter: fix exception when trying to process render targets

fix: pass writer into onAfterHierarchy callback, move onAfterHierarchy callback after scene hierarchy write

pass options and extensions correctly

Only print usdz in debug mode

# Conflicts:
#	examples/jsm/exporters/USDZExporter.js
hybridherbst pushed a commit to needle-tools/three.js that referenced this pull request Apr 22, 2023
lint

minor fix lint extension error

cherry-pick changes done to USDZExporter in the meantime

USDZExporter: Add camera support. (mrdoob#24854)

USDZExporter: Anchoring support (mrdoob#22854)

clean up camera exporting, set default plane to horizontal

USDZExporter: add desktop download button to sample

fix: don't export opacity if model is opaque, leads to incorrect rendering effects

feat: add uv2 support, make sure TextureTransform is only written when needed, use uv2 for occlusion

simplify st / st2 access

USDZExporter: fix exception when trying to process render targets

fix: pass writer into onAfterHierarchy callback, move onAfterHierarchy callback after scene hierarchy write

pass options and extensions correctly

Only print usdz in debug mode

# Conflicts:
#	examples/jsm/exporters/USDZExporter.js
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.

3 participants