Fast Ref
/
API Reference
/
Manage
replace_reference()
Download MarkdownReplaces the specified slot's reference with a new file. Animations, constraints, and other data are automatically handled.
Signature
api.replace_reference(slot: int, new_file: str) -> dict
Parameters
| Parameter | Type | Description |
|---|---|---|
slot |
int |
Slot number to replace (0-9) |
new_file |
str |
Full path to the new .max file |
Return Value
{
"success": True,
"message": str,
"slot": int,
}
Errors
| Error | Cause |
|---|---|
TypeError |
slot is not int (including bool) [v2 added] |
FileNotFoundError |
File not found on disk |
ValueError |
Slot is invalid or empty |
Example
from os_fast_ref.api import FastRefAPI
api = FastRefAPI()
result = api.replace_reference(slot=0, new_file=r"J:\assets\char_v2.max")
print(result['message'])
v2: Confirmation dialog is suppressed automatically.