Support for USD PointInstancer #96747

Open
opened 2022-03-24 05:22:34 +01:00 by Sam Wong · 18 comments

System Information
Operating system: Win10
Graphics card: GTX 1660 Ti

Blender Version
Broken: 3.1

Short description of error
After loading a USD file with type particleInstancer attached with spheres as child, Blender failed to draw the points as spheres. Instead, the displayed object in the layout window is just a singular point at the origin. Example file attached.example_sim_granular.zip

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

**System Information** Operating system: Win10 Graphics card: GTX 1660 Ti **Blender Version** Broken: 3.1 **Short description of error** After loading a USD file with type particleInstancer attached with spheres as child, Blender failed to draw the points as spheres. Instead, the displayed object in the layout window is just a singular point at the origin. Example file attached.[example_sim_granular.zip](https://archive.blender.org/developer/F12942071/example_sim_granular.zip) **Exact steps for others to reproduce the error** Based on the default startup or an attached .blend file (as simple as possible).
Author

Added subscriber: @anthropoy

Added subscriber: @anthropoy
Member

Added subscribers: @makowalski, @dr.sybren, @lichtwerk

Added subscribers: @makowalski, @dr.sybren, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

@makowalski : havent gotten to building USD to get access to utils that let me examine a.usd the same way I can examine an alembic .abc (so I cannot really tell how the USD looks from the inside), but I assume this is not implemented yet?
For me, a single empty is imported here (under another empty for the particle system under another empty as the root).
Also not sure if the plans are to do it like alembic in blender [which imports verts with meshsequence cache modifier for plain particles or objects with transform caches for instanced particles afaict], or if this will somehow end up on the pointcloud type?

CC @dr.sybren

@makowalski : havent gotten to building USD to get access to utils that let me examine a.usd the same way I can examine an alembic .abc (so I cannot really tell how the USD looks from the inside), but I assume this is not implemented yet? For me, a single empty is imported here (under another empty for the particle system under another empty as the root). Also not sure if the plans are to do it like alembic in blender [which imports verts with meshsequence cache modifier for plain particles or objects with transform caches for instanced particles afaict], or if this will somehow end up on the pointcloud type? CC @dr.sybren

In #96747#1329193, @lichtwerk wrote:
@makowalski : havent gotten to building USD to get access to utils that let me examine a.usd the same way I can examine an alembic .abc (so I cannot really tell how the USD looks from the inside), but I assume this is not implemented yet?
For me, a single empty is imported here (under another empty for the particle system under another empty as the root).
Also not sure if the plans are to do it like alembic in blender [which imports verts with meshsequence cache modifier for plain particles or objects with transform caches for instanced particles afaict], or if this will somehow end up on the pointcloud type?

CC @dr.sybren

Hello @lichtwerk. In this case, the USD contains a PointInstancer. Indeed, this hasn't been implemented yet. (In the universal-scene-description branch there is support for importing scene instances but not point instances.) I am leaning towards importing PointInstancers into Blender as particle systems with particles represented as meshes. But this is open to discussion, of course, and we could potentially provide more than one option. Regardless, supporting point instancing is an important feature I was planning to add.

> In #96747#1329193, @lichtwerk wrote: > @makowalski : havent gotten to building USD to get access to utils that let me examine a.usd the same way I can examine an alembic .abc (so I cannot really tell how the USD looks from the inside), but I assume this is not implemented yet? > For me, a single empty is imported here (under another empty for the particle system under another empty as the root). > Also not sure if the plans are to do it like alembic in blender [which imports verts with meshsequence cache modifier for plain particles or objects with transform caches for instanced particles afaict], or if this will somehow end up on the pointcloud type? > > CC @dr.sybren Hello @lichtwerk. In this case, the USD contains a PointInstancer. Indeed, this hasn't been implemented yet. (In the `universal-scene-description` branch there is support for importing scene instances but not point instances.) I am leaning towards importing PointInstancers into Blender as particle systems with particles represented as meshes. But this is open to discussion, of course, and we could potentially provide more than one option. Regardless, supporting point instancing is an important feature I was planning to add.
Author

Hi @makowalski, it would be great to have the option that the PointInstancers be imported as particle systems and the particles to be represented by the "child" attached to the PointInstancers.

Hi @makowalski, it would be great to have the option that the PointInstancers be imported as particle systems and the particles to be represented by the "child" attached to the PointInstancers.

Thank you for the feedback @anthropoy. I am investigating this option and will post progress in this task.

Thank you for the feedback @anthropoy. I am investigating this option and will post progress in this task.

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Philipp Oeser changed title from Error loading USD file with point type to Support for USD PointInstancer 2022-03-24 16:11:28 +01:00
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

it would be great to have the option that the PointInstancers be imported as particle systems

Since the old particle system is deprecated, I don't think this is the right approach. Without more knowledge of USD I'm not sure what to suggest instead, but I would think something using the same type of instances generated by geometry nodes would be preferable (see InstancesComponent). That has support for arbitrary generic attributes on instances.

> it would be great to have the option that the PointInstancers be imported as particle systems Since the old particle system is deprecated, I don't think this is the right approach. Without more knowledge of USD I'm not sure what to suggest instead, but I would think something using the same type of instances generated by geometry nodes would be preferable (see `InstancesComponent`). That has support for arbitrary generic attributes on instances.

In #96747#1330027, @HooglyBoogly wrote:

it would be great to have the option that the PointInstancers be imported as particle systems

Since the old particle system is deprecated, I don't think this is the right approach. Without more knowledge of USD I'm not sure what to suggest instead, but I would think something using the same type of instances generated by geometry nodes would be preferable (see InstancesComponent). That has support for arbitrary generic attributes on instances.

Thanks @HooglyBoogly! I'll investigate your suggestion.

> In #96747#1330027, @HooglyBoogly wrote: >> it would be great to have the option that the PointInstancers be imported as particle systems > Since the old particle system is deprecated, I don't think this is the right approach. Without more knowledge of USD I'm not sure what to suggest instead, but I would think something using the same type of instances generated by geometry nodes would be preferable (see `InstancesComponent`). That has support for arbitrary generic attributes on instances. Thanks @HooglyBoogly! I'll investigate your suggestion.
Member

I'm guessing here a bit, but one approach would be creating a point cloud with a geometry nodes modifier that uses the Instance on Points node. All of the instances could go in a collection, and the point cloud could have an instance_index attribute used to choose the correct instance.

I'm guessing here a bit, but one approach would be creating a point cloud with a geometry nodes modifier that uses the `Instance on Points` node. All of the instances could go in a collection, and the point cloud could have an `instance_index` attribute used to choose the correct instance.

In #96747#1331137, @HooglyBoogly wrote:
I'm guessing here a bit, but one approach would be creating a point cloud with a geometry nodes modifier that uses the Instance on Points node. All of the instances could go in a collection, and the point cloud could have an instance_index attribute used to choose the correct instance.

Yes, that sounds like a promising approach!

> In #96747#1331137, @HooglyBoogly wrote: > I'm guessing here a bit, but one approach would be creating a point cloud with a geometry nodes modifier that uses the `Instance on Points` node. All of the instances could go in a collection, and the point cloud could have an `instance_index` attribute used to choose the correct instance. Yes, that sounds like a promising approach!

Added subscriber: @zNight

Added subscriber: @zNight
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:40:38 +01:00
Philipp Oeser removed the
Interest
Pipeline, Assets & IO
label 2023-02-10 08:54:05 +01:00
Bastien Montagne modified the project from Pipeline, Assets & IO to USD 2023-02-10 11:08:11 +01:00
Contributor

I've started hacking out support for point instancers here: https://projects.blender.org/blender/blender/compare/universal-scene-description...expenses/blender:usd-read-pointinstancer.

Things seems fairly straightforward so far, with two exceptions:

  • The rotations for the points are presented as quaternions, and point clouds have a quaternion attribute type, but there's no support in geometry nodes for quaternions currently so I'm not sure how this should be handled.
  • stage.GetPrototypes() doesn't return prototypes for point instancers currently, so these have to be fetched via a different method.

I'm happy to continue with the branch and to try and get it merged in, but I think I need some advice on these two aspects.

I've started hacking out support for point instancers here: https://projects.blender.org/blender/blender/compare/universal-scene-description...expenses/blender:usd-read-pointinstancer. Things seems fairly straightforward so far, with two exceptions: - The rotations for the points are presented as quaternions, and point clouds have a quaternion attribute type, but there's no support in geometry nodes for quaternions currently so I'm not sure how this should be handled. - `stage.GetPrototypes()` doesn't return prototypes for point instancers currently, so these have to be fetched via a different method. I'm happy to continue with the branch and to try and get it merged in, but I think I need some advice on these two aspects.
Contributor

Additionally, here's what I imagine the geometry node setup to look like. No surprises really, just a question of what to do about rotations.

Additionally, here's what I imagine the geometry node setup to look like. No surprises really, just a question of what to do about rotations.
Member

but there's no support in geometry nodes for quaternions currently so I'm not sure how this should be handled.

The "Instance on Points" node doesn't have a rotation socket input yet, but geometry nodes does support the rotation (quaternion) data type. You can use a "Rotation to Euler" node to connect a quaternion attribute to the node.

>but there's no support in geometry nodes for quaternions currently so I'm not sure how this should be handled. The "Instance on Points" node doesn't have a rotation socket input yet, but geometry nodes does support the rotation (quaternion) data type. You can use a "Rotation to Euler" node to connect a quaternion attribute to the node.
Contributor

@HooglyBoogly Oh, you're right! The changes that add that type haven't made it over to the universal-scene-description branch yet.

@HooglyBoogly Oh, you're right! The changes that add that type haven't made it over to the `universal-scene-description` branch yet.
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
6 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#96747
No description provided.