Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Changed the UOpenPypePublishInstance to use the UDataAsset class #4124

Conversation

Casgen
Copy link
Contributor

@Casgen Casgen commented Nov 23, 2022

Brief description

The UOpenPypePublishInstance now uses the UDataAsset to store references to saved assets.

Description

  • UOpenPypePublishInstance derives from the UPrimaryDataAsset.
  • Assets are now either Internal (UOpenPypePublishInstance monitors it's own directory and subdirectories for changes) or external (Assets which can be added in from other locations).
  • Created new functions to get external, internal or all assets combined.
  • AssetData variables use TSets to ensure there are no duplicate assets being added. A check is also implemented between the external and internal TSets which also monitor, if a user isn't trying to add an duplicate asset to external container, if it already exists in the internal one.
  • There is also a check to make sure the user doesn't include the UOpenPypePublishInstance itself.

Additional info

To allow to edit the external asset container (TSet), user has to tick the 'Add External Assets' to allow him to expose the container. Note that externally added are not managed automatically whatsoever. They are managed manually! Also if the variable is unticked, the GetAllAssets() function behaves differently (It will not include the External Assets).

The TSets also use TSoftObjectPtrs. That means it references the assets on the drive, not the memory. The getter functions already take care of initializing into memory though.

Testing notes:

Creation of the Publish Instance

  1. Open the Unreal Project
  2. Create a new Camera through the OpenPype Creator {A new UOpenPypePublishInstance should be created)
  3. Check in the UOpenPypePublishInstance Asset, if the newly created "cameraDefault.uasset" is automatically included in the 'AssetDataInternal'. Make sure to also save the newly created asset "cameraDefault.uasset".

Monitoring of newly added assets

  1. When a UOPPublishInstance is created, create a new asset in the same directory or subdirectory where the UOPPublishInstance asset is located (for instance Material)
  2. Check in the details panel of UOPPublishInstance, if the newly created asset is added into the "AssetDataInternal"

Checking if the UOPPublishInstance can not be added into the "AssetDataExternal" Container.

  1. Open the details panel in UOPPublishInstance
  2. Try to add the the same or other UOPPublishInstance asset.
  3. Editor shouldn't allow the user to add this kind of asset, and is warned by a notification.

Prohibition of adding a duplicate asset into 'AssetDataExternal', which is already contained in 'AssetDataInternal'.

  1. UOPPublishInstance has to have at least one asset included in 'AssetDataInternal'.
  2. Try to add a duplicate asset contained in 'AssetDataInternal' to 'AssetDataExternal'.
  3. User should be notified by the editor, that he can not add Assets to the external container which are already contained in the Internal container.

TSets now use TSoftObjectPtr<> for referencing the assets, which can reduce memory usage.
@ynbot
Copy link
Contributor

ynbot commented Nov 23, 2022

Task linked: OP-3950 Use DataAsset as container

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

Except the path in include, everything works! Thanks.

@jakubjezek001 jakubjezek001 removed this from the 3.14.7 milestone Nov 25, 2022
Renamed the include to "Framework/Notifications/NotificationManager.h"

Co-authored-by: Ondřej Samohel <33513211+antirotor@users.noreply.github.com>
@antirotor antirotor added the type: enhancement Enhancements to existing functionality label Dec 2, 2022
@antirotor antirotor merged commit b9e8e81 into ynput:develop Dec 2, 2022
@github-actions github-actions bot added this to the next-patch milestone Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: UE type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants