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

Load VDB to Redshift: Create and assign a RedshiftStandardVolume material on load #220

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

BigRoy
Copy link
Contributor

@BigRoy BigRoy commented Jan 15, 2025

Changelog Description

Create and assign a RedshiftStandardVolume material on loading VDB to Redshift.

image
image

This also fixes an issue where on load Redshift would sometimes report a warning that the file does not exist (because Maya still had to initialize the useFrameExtension behavior). This PR now directly forces maya to evaluate that and avoids the warning like:

// Warning:  [Redshift] Failed to find volume file C:/projects/ayontest/asset/char_hero/publish/vdbcache/vdbcacheMain/v005/ynts_char_hero_vdbcacheMain_v005.0001.vdb. Volume will be empty

Additional review information

The option can be disabled on the Load action via the option box on the action itself.

This avoids the issue that when loading the VDB that by default it would NOT display in the render - usually Redshift would log that it had no shader and hence be skipped. Now, a shader is created and assigned and the field channel to use is guessed from the available grid names: use density if available, otherwise use first grid name which may save time as to debug "why doesn't it render?" and typing a valid channel name manually by the artist.

It does introduce potential follow up issue:

  1. These materials are unmanaged (not in the container currently), and removing the Volume from the scene via scene inventory will keep the material around. If we were to add it to the container we get to the downside that the material may be used by the artist for other objects in the scene. The question is, which of the two behaviors would be worse?
  2. Each load of a Redshift Volume would now generate a new shader in the scene. It may be unwanted.

The creation will also be logged:

// ProductLoader : Created RedshiftStandardVolume: 'rsStandardVolume12' using channel 'surface'

Testing notes:

  1. Load Volume to Redshift.
  2. With the material applied it should directly be able to render.

@BigRoy BigRoy added type: enhancement Improvement of existing functionality or minor addition community Issues and PRs coming from the community members labels Jan 15, 2025
@BigRoy BigRoy self-assigned this Jan 15, 2025
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

I have used tray publisher to ingest some VDB cache file from internet (Embergen)

and Im getting this error once using Ayon>Load VDB (Redshift) I guess its because it has just density grid inside not color

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.13\ayon_core\tools\loader\models\actions.py", line 740, in _load_representations_by_loader
    load_with_repre_context(
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.13\ayon_core\pipeline\load\utils.py", line 325, in load_with_repre_context
    return loader.load(repre_context, name, namespace, options)
  File "c:\Work\REPO\ayon-maya\client\ayon_maya\plugins\load\load_vdb_to_redshift.py", line 94, in load
    self._create_default_redshift_volume_shader(volume_node)
  File "c:\Work\REPO\ayon-maya\client\ayon_maya\plugins\load\load_vdb_to_redshift.py", line 175, in _create_default_redshift_volume_shader
    cmds.connectAttr(f"{material}.outColor",
RuntimeError: The source attribute 'unknown1.outColor' cannot be found.```



once assigned the shader manually and inspect the asset (data is ok)


![Screenshot 2025-01-17 103416](https://github.com/user-attachments/assets/d5574597-8928-4916-9ffd-6b0b3e521cc6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants