alc.config¶
Studio and project configuration.
alc.config ¶
AlchemyConfig ¶
Bases: BaseSettings
software_registry
cached
property
¶
Lazy-loads the DCC registry. If it doesn't exist in memory, it triggers the load/scan logic.
company_id
property
writable
¶
The grounded company id: the active web request's /c/{cid} when a
request context is active (see :mod:alc.context), else the persisted
boot selection. DCC/CLI/farm code never activates a context, so outside
the web app this is always the boot value.
company
property
¶
Returns the active company object based on company_id.
project
property
¶
The grounded project: the request's /project/{pid} URL segment
when the active web context carries one (a URL naming a project the
company doesn't have resolves to None — surface the error, don't ground
to a different project), else the grounded company's persisted current.
cookbook_import_root
property
¶
The cookbook import anchor — the parent of the cookbook
package, i.e. the directory that must be on sys.path for
import cookbook.* to resolve. Distinct from cookbook_dir (the
cookbook package / git root itself). This is the single path meaning
"where Python imports the cookbook from"; use
env.ensure_cookbook_on_path() to actually wire it into an
interpreter.
cookbook_root
property
¶
Deprecated alias for :attr:cookbook_import_root. The name read as
"root of the cookbook" and was ambiguous with the git root; prefer
cookbook_import_root in new code.
perforce_root
property
¶
The active company's Perforce workspace root (Unreal lives here).
Distinct from prod_root (the VERSIONS/PUBLISHES tree) — Unreal/Perforce
content is rooted here (e.g. C:/alc/p4v). The route engine uses it to
decompose live .uproject / Content paths into PathObjects.
task_registry
property
¶
Lazy-loads the DCC registry. If it doesn't exist in memory, it triggers the load/scan logic.
textures_config
property
¶
Texture conventions (e.g. UDIM channel names). Empty dict when the config file is absent — callers (e.g. is_udim) treat that as 'unknown'.
python_path
property
¶
Return the packaged python path, or with development return the code_root venv. Returns:
get_instance
classmethod
¶
The absolute entry point. Ensures one manifest rules them all.
Source code in alc\config\config.py
sync_environment ¶
Ensures the OS environment matches the validated Pydantic state.
Source code in alc\config\config.py
set_current_project ¶
Sets the current project for the active company. updates the config on disk. Args: project_id:
Returns:
Source code in alc\config\config.py
set_current_company ¶
Sets the current company. updates the config on disk. Args: company_id:
Returns:
Source code in alc\config\config.py
add_company ¶
Registers a new company in the config and writes it to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
company_id
|
str
|
The 3-letter company code (e.g. 'cgl'). |
required |
label
|
str
|
The human-readable company name. |
required |
prod_root
|
str
|
Optional production root for the company. |
''
|
Returns:
| Type | Description |
|---|---|
Company
|
The Company that is now registered (existing one if it already existed). |
Source code in alc\config\config.py
update ¶
Creates a new instance with updated fields and updates the singleton.
Source code in alc\config\config.py
commit ¶
Serializes the current state of the model and writes it to the config_file.
Source code in alc\config\config.py
get_software_cookbooks ¶
Returns:
Source code in alc\config\config.py
get_recipe ¶
Fetches a recipe based on software, task, and recipe type. Args: software: The name of the DCC software (e.g., "maya"). task: The production task (e.g., "modeling"). recipe_type: The type of recipe (e.g., "default", "publish").
Returns:
| Type | Description |
|---|---|
Optional[Recipe]
|
A Recipe object if found, otherwise None. |
Source code in alc\config\config.py
SoftwareRegistry ¶
Bases: BaseModel
software_list
property
¶
Helper to get software as a list for easier UI rendering.
load
classmethod
¶
Modified to mirror the AllSoftware migration and loading logic.
Source code in alc\config\software.py
ext_index ¶
Map .ext -> software id, built from the registry's extension
attrs. source_extensions win over output_extensions (a .ma is a
Maya scene, not whatever exports .ma); within a tier, registry order
decides ties. Cached until the next save().
Source code in alc\config\software.py
software_for_ext ¶
The software that owns a file extension (e.g. '.blend' -> Blender).
icon_for_path ¶
Best icon url (svg > png > None) for a file, keyed on its extension. The single entry point the UI uses to badge a file with its app icon.
Source code in alc\config\software.py
hydrate ¶
The Master Blender: Merges Web Metadata with local discovery.
Source code in alc\config\software.py
save ¶
Persists state back to software.json.
Source code in alc\config\software.py
get_column ¶
Returns tools for a shelf, sorted by status and name.
Source code in alc\config\software.py
update_tool ¶
toggle_tool ¶
Toggles the tool state and ensures the object is synced for the UI.
Source code in alc\config\software.py
get_category_color ¶
Helper to get the HSL color for a category based on the first tool found.
Source code in alc\config\software.py
UserConfig ¶
Bases: BaseModel
is_installed ¶
Consolidated DCC check. Example: user_cfg.is_installed('maya', '2024')
Source code in alc\config\user.py
__getattr__ ¶
Magic Method: Allows for user_cfg.maya_installed style calls without writing 50 properties.
Source code in alc\config\user.py
commit ¶
Writes current state to disk.
Source code in alc\config\user.py
edit ¶
Updates the current instance with new values and commits.
update_installs ¶
Helper to manage the 'installs' dictionary specifically.
Source code in alc\config\user.py
set_dcc ¶
init_logging ¶
Standardized logging config for all Alchemy scripts. Ensures -u unbuffered output works correctly with our terminal stream.