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

Ability to add custom directory path inputs to cache/proxies/gallery stills/powergrades/captures #39

Open
Conojomo opened this issue Nov 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Conojomo
Copy link

Hello,

My goal is to create an automated script to create a new project and save the presets for the specific database. However the request is to have the ability to add custom directory path inputs for

proxy generation location
cache files location
gallery stills location

Screen Shot 2023-11-19 at 7 32 30 PM

capture and playback / Capture / Save clips to
Screen Shot 2023-11-19 at 7 32 49 PM

Setting powergrade location
Screen Shot 2023-11-19 at 7 33 03 PM

with final step to then set as resolve data base preset.
Screen Shot 2023-11-19 at 7 33 15 PM

I am eager to learn more about this python package
I see there might already be one made which might work.
(settings.perf.cache_clips_location: Optional[Union[Path, str]])
I will test.

I suppose I could accomplish this task using outside UI - looking forward to learning about this package and eventually adding to it

Thanks for your time.

@Conojomo Conojomo added the enhancement New feature or request label Nov 20, 2023
@Conojomo
Copy link
Author

Conojomo commented Nov 27, 2023

I figured out how to do part of this in regular API - but I guess my hands are tied if there is missing values in Davinci Resolves main API. As there is no proxy generation location / powergrade location from what I can find in 'GetSettings()'. ---- but here is how I was able to change Capture, Cache Files and Gallery Stills location.

#############

import DaVinciResolveScript as dvr_script

#Connect to DaVinci Resolve API
resolve_DaV_api = dvr_script.scriptapp("Resolve")

resolve_version_DaV_api = resolve_DaV_api.GetVersion()
print(f"resolve version: {resolve_version_DaV_api}")

project_manager_DaV_api = resolve_DaV_api.GetProjectManager()

#Get Current Database
current_database = project_manager_DaV_api.GetCurrentDatabase()
print(f"current_database: {current_database}")

#Get Current Project
current_project_DaV_API = project_manager_DaV_api.GetCurrentProject()

#Get all settings within that project
all_settings = current_project_DaV_API.GetSetting("")
print(f"all_settings in Project: {all_settings}\n\n")

def set_project_setting(project, setting_name, value):
if project.SetSetting(setting_name, value):
print(f"Success: Setting '{setting_name}' updated to '{value}'")
else:
print(f"Failed: to update '{setting_name}'")

if current_project_DaV_API:

formatted_cache_paths = r"C:/Users/John_Smith/Desktop/TEST"
cache_clip_path_addition = "/CacheClip"
gallery_stills_path_addition = "/.gallery"

CacheClipsLocation_chosen_path = formatted_cache_paths + cache_clip_path_addition if formatted_cache_paths else ""
gallery_chosen_path = formatted_cache_paths + gallery_stills_path_addition if formatted_cache_paths else ""
videoCaptureLocation_chosen_path = formatted_cache_paths if formatted_cache_paths else ""

# Update settings
settings_to_update = {
    #Project Settings/Master Settings
    "perfCacheClipsLocation": CacheClipsLocation_chosen_path,
    "colorGalleryStillsLocation": gallery_chosen_path,
    "videoCaptureLocation": videoCaptureLocation_chosen_path
}

for setting, value in settings_to_update.items():
    set_project_setting(current_project_DaV_API, setting, value)

else:
print("No Current Project found.")

################

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant