RNA: move the read-only extension "directory" to RNA
This allows it to be exposed in the user interface when the custom-directory is disabled without having to use a label which can't handle non UTF-8 characters which file-paths can contain.
This commit is contained in:
@@ -1312,24 +1312,6 @@ class RenderEngine(StructRNA, metaclass=RNAMeta):
|
||||
__slots__ = ()
|
||||
|
||||
|
||||
class UserExtensionRepo(StructRNA):
|
||||
__slots__ = ()
|
||||
|
||||
@property
|
||||
def directory(self):
|
||||
"""Return ``directory`` or a default path derived from the users scripts path."""
|
||||
if self.use_custom_directory:
|
||||
return self.custom_directory
|
||||
import bpy
|
||||
import os
|
||||
# TODO: this should eventually be accessed via `bpy.utils.user_resource('EXTENSIONS')`
|
||||
# which points to the same location (by default).
|
||||
if (path := bpy.utils.resource_path('USER')):
|
||||
return os.path.join(path, "extensions", self.module)
|
||||
# Unlikely this is ever encountered.
|
||||
return ""
|
||||
|
||||
|
||||
class HydraRenderEngine(RenderEngine):
|
||||
__slots__ = ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user