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

Houdini: Better support for single frame outputs #238

Closed
2 tasks done
BigRoy opened this issue Mar 25, 2024 · 5 comments
Closed
2 tasks done

Houdini: Better support for single frame outputs #238

BigRoy opened this issue Mar 25, 2024 · 5 comments
Assignees
Labels
backlog added into backlog community Issues and PRs coming from the community members host: Houdini type: bug Something isn't working

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Mar 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior:

A lot of extractor seems to rely on instance.data["frames"] to be a list of files:

However it's a single file if the instance has no frame range data.

If it has frame range data but a it's a single frame then I believe these extractors end up setting a single file list like: representation["files"] = ["single_file.1001.exr"] - which the integrator does not tend to like.

For example, a single frame COP2 image publish errors with the following report:

publish-report-240325-17-47.json

The integrator wants single files to be a single filename instead of a list.

Expected Behavior:

There should be simple consistency across the API, so I suppose instance.data["frames"] should at best always be a list. We should then however just restructure the representation["files"] to be a single filename instead of the list of files.

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Publish a single frame of a sequenced product type, e.g. image sequence (COP2), bgeo, vdb

Are there any labels you wish to add?

  • I have added the relevant labels to the bug report.

Relevant log output:

Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Ynput\AYON\dependency_packages\ayon_2403061937_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "E:\dev\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 232, in process
    six.reraise(*sys.exc_info())
  File "C:\Program Files\Side Effects Software\Houdini 20.0.590\python310\lib\site-packages\six.py", line 719, in reraise
    raise value
  File "E:\dev\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 219, in process
    self.register(instance, file_transactions, filtered_repres)
  File "E:\dev\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 412, in register
    op_session.commit()
  File "C:\Program Files\Ynput\AYON 1.0.2\dependencies\ayon_api\operations.py", line 701, in commit
    self._con.send_batch_operations(
  File "C:\Program Files\Ynput\AYON 1.0.2\dependencies\ayon_api\server_api.py", line 6575, in send_batch_operations
    raise FailedOperations((
ayon_api.exceptions.FailedOperations: Operation "6ec98b42-d9db-4f78-8830-ff13b2f0af7a" failed with data:
{
    "id": "6ec98b42-d9db-4f78-8830-ff13b2f0af7a",
    "type": "create",
    "entityType": "representation",
    "entityId": "7372cb33eac711eeab71a3d64c91bc2b",
    "data": {
        "id": "7372cb33eac711eeab71a3d64c91bc2b",
        "versionId": "7366107deac711ee9003a3d64c91bc2b",
        "files": [
            {
                "id": "737e65b5eac711ee9c30a3d64c91bc2b",
                "name": "ynts_char_hero_imagesequenceMain_v003.",
                "path": "{root[work]}/ayontest/asset/char_hero/publish/imagesequence/imagesequenceMain/v003/ynts_char_hero_imagesequenceMain_v003.",
                "size": 66396,
                "hash": "ynts_char_hero_imagesequenceMain_v003,|1711385284,74326|66396",
                "hash_type": "op3"
            }
        ],
        "name": "",
        "data": {
            "context": {
                "root": {
                    "work": "C:/projects"
                },
                "project": {
                    "name": "ayontest",
                    "code": "ynts"
                },
                "hierarchy": "asset",
                "folder": {
                    "name": "char_hero"
                },
                "product": {
                    "name": "imagesequenceMain",
                    "type": "imagesequence"
                },
                "version": 3,
                "ext": "",
                "asset": "char_hero",
                "task": {
                    "name": "modeling",
                    "type": "Modeling",
                    "short": "mdl"
                },
                "subset": "imagesequenceMain",
                "family": "imagesequence",
                "representation": "",
                "username": "admin",
                "user": "admin"
            }
        },
        "attrib": {
            "path": "C:\\projects\\ayontest\\asset\\char_hero\\publish\\imagesequence\\imagesequenceMain\\v003\\ynts_char_hero_imagesequenceMain_v003.",
            "template": "{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/publish/{product[type]}/{product[name]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}"
        }
    }
}
Detail: 1 validation error for RepresentationPostModel
name
  string does not match regex "^[a-zA-Z0-9_]([a-zA-Z0-9_\.\-]*[a-zA-Z0-9_])?$" (type=value_error.str.regex; pattern=^[a-zA-Z0-9_]([a-zA-Z0-9_\.\-]*[a-zA-Z0-9_])?$).

This is an example where e.g. the extractor fails to retrieve the extension because it's expecting a list of files, not a string.

Additional context:

No response

[cuID:AY-4795]

@BigRoy BigRoy added host: Houdini type: bug Something isn't working labels Mar 25, 2024
@MustafaJafar
Copy link
Contributor

The integrator wants single files to be a single filename instead of a list.

I do remember something like that. I faced that in #9
tbh, I accepted it as a fact in my PR.

files = []
# Non Render Products with frames
frames = instance.data.get("frames", [])
staging_dir, _ = os.path.split(filepath)
if isinstance(frames, str):
files = [os.path.join(staging_dir, frames)]
else:
files = [os.path.join(staging_dir, f) for f in frames]
# Render Products
expectedFiles = instance.data.get("expectedFiles", [])
for aovs in expectedFiles:
# aovs.values() is a list of lists
files.extend(sum(aovs.values(), []))
# Intermediate exported render files.
# TODO : For products like Karma,
# Karma has more intermediate files
# e.g. USD and checkpoint
ifdFile = instance.data.get("ifdFile")
if self.intermediate_exported_render and ifdFile:
start_frame = instance.data.get("frameStartHandle", None)
end_frame = instance.data.get("frameEndHandle", None)
ifd_files = self._get_ifd_file_list(ifdFile,
start_frame, end_frame)
files.extend(ifd_files)
# Non Render Products with no frames
if not files:
files.append(filepath)

@MustafaJafar
Copy link
Contributor

Also, I'd like to thank you because I finally found the issue with image sequence in Houdini!
It only works if frame range is more than 1!

@MustafaJafar MustafaJafar added the community Issues and PRs coming from the community members label Mar 26, 2024
@MustafaJafar MustafaJafar added the backlog added into backlog label Apr 8, 2024
@antirotor
Copy link
Member

antirotor commented Apr 9, 2024

This should be partly solved by #105 - but it will need some additional work on Houdini support side

@antirotor antirotor reopened this Apr 9, 2024
@BigRoy
Copy link
Collaborator Author

BigRoy commented Jul 3, 2024

The actual bugs that existed here should've been solved by #676 because it moved the extraction logic into a single plug-in which meant less duplicated code involving this. So we could close this - unless we want to keep it open to track a larger redesign of how we're dealing with files, etc. But I feel #105 already represents that maybe?

Should we close this one?

@MustafaJafar
Copy link
Contributor

IMO, this issue was made originally to track the issue that most extractors expected instance.data["frames"] to be a list.
which was solved by as you have mentioned #676 .
if we want to suggest new design for ayon we can create another issue.

@BigRoy BigRoy closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog added into backlog community Issues and PRs coming from the community members host: Houdini type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants