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

Refactorization of folder coloring #4211

Merged

Conversation

Casgen
Copy link
Contributor

@Casgen Casgen commented Dec 12, 2022

Brief description

Refactored the ability to alter folder colors.

Description

In the Unreal host plugin, the SetFolderColor() function has been changed to alter the color on the fly when called. To distuingish the OpenPype folder from others, UOpenpypePublishInstances now have a function to color the paths in which they are located.

Since the color should be set firsthand, a new UOpenPypeSettings class and .ini file has been created to alter the options by the user. That way we can set defaults without accesing the .cpp files directly. It can also be altered in the "Project Settings" tab in UE. this could be used of course for future use.

Additional info

The .ini file is included in the Config folder (Config/DefaultOpenPypeSettings.ini)

Testing notes:

Check whether the folder from OpenPype and it's subpaths are colored.

  1. Create a new project.
  2. After creating the project create a new asset within the OpenPype menu (for instance a camera).
  3. After the creation, the newly generated folders should be colored in a sky blue color.

Testing the set_folder_color function

  1. Try to call the set_folder_color function within OpenPype (or within the cmd in UE) and choose a folder to color with a FLinearColor object (if you are not sure about the params. see with the 'help' function). Make sure that the directory is written correctly, ex. unreal.OpenPypeLib.set_folder_color('/Game/OpenPype/Instances/cameraDefault', unreal.LinearColor(a=1.0,r=0.8,g=0.1,b=0.3), False)
  2. After executing the function (or executing the command in UE) the color should automatically change without reloading the engine. (A message will appear in the Output Log of UE if the color has been set correctly or not).

NOTE: Since the OpenPypeLib.h is not a UObject anymore but a UBlueprintFunctionLibrary you can directly call the function without creating the UObject! (for instance, use unreal.OpenPypeLib.set_folder_color(...)

Changing the color in project settings

  1. Go to "Project Settings" under the "Edit" tab.
  2. Look for the OpenPype section and open its settings.
  3. When opened, there should be an option for setting the folder color (If you don't see the option, dont forget to expand those tabs to show the options).
  4. When you set a different color and reload UE, the folder should change their color to the newly set value.

@ynbot
Copy link
Contributor

ynbot commented Dec 12, 2022

Task linked: OP-4152 Refactor folder colors

@antirotor antirotor added host: UE type: enhancement Enhancements to existing functionality labels Dec 12, 2022
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.

It works great, apart of those includes in UE5.1 - thanks!

@antirotor antirotor merged commit dd84b34 into ynput:develop Dec 22, 2022
@github-actions github-actions bot added this to the next-patch milestone Dec 22, 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.

4 participants