USD importer ignores camera near clipping plane #116346

Closed
opened 2023-12-19 15:19:02 +01:00 by Matt-M · 1 comment

System Information
Operating system: Linux-6.2.0-1017-lowlatency-x86_64-with-glibc2.38 64 Bits, X11 UI
Graphics card: Quadro RTX 6000/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.129.03

Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727

Short description of error
When importing a USDA file into Blender which defines a camera prim, the camera FAR clipping plane is imported correctly, but the NEAR clipping plane is ignored completely and set to the default of 0.1 regardless of file contents.

Exact steps for others to reproduce the error

  1. Create a Blender scene which contains only a single camera.
  2. Set the camera to have distinctive values for the near and far clipping planes (e.g. 56 and 12345).
  3. Export the scene to a USDA file.
  4. Confirm the the USDA file has the correct exported values in the camera prim's "clippingRange" attribute.
  5. Start a new Blender scene.
  6. Import the USDA file created in step 3.
  7. Examine the clipping planes of the camera object in the Blender scene.

Expected: The Blender camera object should have the clipping planes set in step 2 (e.g. 56 and 12345).

Actual: The Blender camera object has the correct FAR clipping plane (12345) but the NEAR clipping plane is set to 0.1.

Additional:

Confirmed by examining the code in source/blender/io/usd/intern/usd_reader_camera.cc:

/* Call UncheckedGet() to silence compiler warnings.
 * Clamp to 1e-6 matching range defined in RNA. */
bcam->clip_end = clippingRangeVal.UncheckedGet<pxr::GfVec2f>()[1];

Only the clip_end value is being set, and only the [1] index of the clippingRangeVal is being accessed (i.e. the Y coordinate of the GfVec2f, which in this case corresponds to the far clip distance).

**System Information** Operating system: Linux-6.2.0-1017-lowlatency-x86_64-with-glibc2.38 64 Bits, X11 UI Graphics card: Quadro RTX 6000/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.129.03 **Blender Version** Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` **Short description of error** When importing a USDA file into Blender which defines a camera prim, the camera FAR clipping plane is imported correctly, but the NEAR clipping plane is ignored completely and set to the default of 0.1 regardless of file contents. **Exact steps for others to reproduce the error** 1. Create a Blender scene which contains only a single camera. 2. Set the camera to have distinctive values for the near and far clipping planes (e.g. 56 and 12345). 3. Export the scene to a USDA file. 4. Confirm the the USDA file has the correct exported values in the camera prim's "clippingRange" attribute. 5. Start a new Blender scene. 6. Import the USDA file created in step 3. 7. Examine the clipping planes of the camera object in the Blender scene. Expected: The Blender camera object should have the clipping planes set in step 2 (e.g. 56 and 12345). Actual: The Blender camera object has the correct FAR clipping plane (12345) but the NEAR clipping plane is set to 0.1. Additional: Confirmed by examining the code in source/blender/io/usd/intern/usd_reader_camera.cc: ``` /* Call UncheckedGet() to silence compiler warnings. * Clamp to 1e-6 matching range defined in RNA. */ bcam->clip_end = clippingRangeVal.UncheckedGet<pxr::GfVec2f>()[1]; ``` Only the clip_end value is being set, and only the [1] index of the clippingRangeVal is being accessed (i.e. the Y coordinate of the GfVec2f, which in this case corresponds to the far clip distance).
Matt-M added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-12-19 15:19:03 +01:00
Member

Can confirm, this somehow got swallowed in 7a9284107d [I mean, the corresponding clamping comment is already there :) ]

Can confirm, this somehow got swallowed in 7a9284107d9789ce6fd735baf1dbe44e4447a7d2 [I mean, the corresponding clamping comment is already there :) ]
Philipp Oeser added
Module
Pipeline, Assets & IO
Status
Confirmed
Interest
USD
and removed
Status
Needs Triage
labels 2023-12-19 16:08:55 +01:00
Philipp Oeser self-assigned this 2023-12-19 16:12:16 +01:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-12-19 19:01:20 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#116346
No description provided.