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

Fixing multiple : split issue and others small issues #30

Conversation

jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Oct 28, 2024

Changelog Description

  • Fixing: The creator displays 99 but should show 1001 at the workfile start.
  • Non-hero vertical synchronized clips with multiple clips on one track now include a clip index in the product name to prevent duplicate names.

Additional info

resolves #14
resolves #21
resolves #27

Added a debug log statement to display the split comments for better debugging and understanding of the code flow.
add debug logs, update product names to avoid duplicity. Add used clip product names list for reference.
- Simplified accessing tape_name attribute directly instead of using get_value() method.
- Updated logger instantiation to use Logger.get_logger(__name__)
- Replaced self.log with log for consistency and clarity
…level to DEBUG in CreateShotClip

- Added debug logging statement for used_names_list in PublishableClip class
- Changed the logger setup to use Python's built-in logging module with DEBUG level in CreateShotClip class
- Refactored widget creation method parameters order for clarity.
- Updated logger initialization to use custom Logger class.
- Refactored debug log statements for clip_product_name
- Updated logging to include track index and clip index when needed
- Added debug logs for clip_product_name, self.base_product_name, and self.track_name to provide more visibility during processing.
- Update how clip product names are generated and handled in the code to improve clarity and consistency.
@jakubjezek001 jakubjezek001 linked an issue Oct 28, 2024 that may be closed by this pull request
- Updated variable names for clarity
- Improved handling of attribute values based on type
- Enhanced regex pattern usage for better matching
@jakubjezek001 jakubjezek001 added the type: bug Something isn't working label Oct 28, 2024
@jakubjezek001 jakubjezek001 self-assigned this Oct 28, 2024
Simplified a method call by removing unnecessary line breaks.
@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Oct 28, 2024

Is this https://github.com/ynput/ayon-flame/pull/30/files#diff-4e3d68a382b1e3c82be1d67b339fd5931b12f5e8ab16ba58d4df5bc08fb6e198R220 the only change in this PR? Because there is a lot of changes that are not related to description, it is really hard to see what "actually" changed...

If there would be option to move code refactor to different PR it would help.

jakubjezek001 and others added 3 commits October 29, 2024 10:15
- Refactored the loop to handle clip frame range comparisons more efficiently.
- Improved handling of product names and indices for track clips.
Comment on lines 250 to 282
pattern = TXT_PATTERN
if a_type in ("number", "float"):
pattern = NUM_PATERN
pattern = NUM_PATTERN

res_goup = pattern.findall(value)
res_group = pattern.findall(value)

# raise if nothing is found as it is not correctly defined
if not res_goup:
if not res_group:
raise ValueError((
"Value for `{}` attribute is not "
"set correctly: `{}`").format(a_name, split))

if "string" in a_type:
_value = res_goup[0]
_value = res_group[0]
if "float" in a_type:
_value = float(res_goup[0])
_value = float(res_group[0])
if "number" in a_type:
_value = int(res_goup[0])
_value = int(res_group[0])

attributes["xml_overrides"][a_name] = _value

# condition for resolution in key
if "resolution" in key.lower():
res_goup = NUM_PATERN.findall(value)
# check if axpect was also defined
res_group = NUM_PATTERN.findall(value)
# check if aspect was also defined
# 1920x1080x1.5
aspect = res_goup[2] if len(res_goup) > 2 else 1
aspect = res_group[2] if len(res_group) > 2 else 1

width = int(res_goup[0])
height = int(res_goup[1])
width = int(res_group[0])
height = int(res_group[1])
pixel_ratio = float(aspect)
attributes["xml_overrides"].update({
"width": width,
Copy link
Member Author

Choose a reason for hiding this comment

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

All these changes are related to typo fixing.

Comment on lines +16 to +17
NUM_PATTERN = re.compile(r"([0-9\.]+)")
TXT_PATTERN = re.compile(r"([a-zA-Z]+)")
Copy link
Member Author

Choose a reason for hiding this comment

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

All these changes are related to typo fixing.

- Adjusted condition to check for exact match instead of inclusion.
- Refactored how clip product names are generated and validated to avoid duplicates.
- Adjusted condition for clip inclusion
- Added new key formation for clip uniqueness
- Updated the list used for duplicity check
…consistency.

- Removed unused Logger import
- Updated log reference to self.log
- Convert width, height, and pixel aspect ratio values to integers or floats as appropriate in multiple files.
Copy link
Contributor

@robin-ynput robin-ynput left a comment

Choose a reason for hiding this comment

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

Tested on the Flame machine and confirm it works as expected to me.

@tatiana-ynput tatiana-ynput merged commit 2f1b4d6 into develop Nov 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
4 participants