Skip to content

Commit

Permalink
Adding var to track if we are using frozen dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Mystfit committed Jul 5, 2023
1 parent ad74fbb commit f39f750
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions StableDiffusionTools/Content/Python/init_unreal.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def load_manifests(manifest_dir):
# Set up virtual environment
legacy_site_packages = pathlib.Path(unreal.Paths().engine_saved_dir()) / "StableDiffusionToolsPyEnv"
default_site_packages = pathlib.Path(__file__).parent.parent.parent / "FrozenPythonDependencies"
frozen_python_deps_available = True if os.path.exists(default_site_packages) else False

if not plugin_options.get_freeze_dependencies() and not os.path.exists(default_site_packages):
default_site_packages = plugin_options.get_python_site_packages_override_path().path

Expand All @@ -81,6 +83,7 @@ def load_manifests(manifest_dir):
# Load dependency manager
dep_manager = dependency_manager.PyDependencyManager()
dep_manager.set_editor_property("PluginSitePackages", str(env_site_packages))
dep_manager.set_editor_property("FrozenDependenciesAvailable", frozen_python_deps_available)
subsystem = unreal.get_editor_subsystem(unreal.StableDiffusionSubsystem)
subsystem.set_editor_property("DependencyManager", dep_manager)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ class STABLEDIFFUSIONTOOLS_API UDependencyManager : public UObject
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "StableDiffusion|Dependencies")
FString PluginSitePackages;

UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "StableDiffusion|Dependencies")
bool FrozenDependenciesAvailable;

//FDependencyInstallProgress OnDependencyProgress;
protected:
UFUNCTION(BlueprintCallable, Category = "StableDiffusion|Dependencies")
Expand Down

0 comments on commit f39f750

Please sign in to comment.