Fast Ref / API Reference / Core

replace_reference()

지정된 슬롯의 레퍼런스를 새 파일로 교체합니다. 애니메이션, 컨스트레인 백업 및 복원이 자동으로 처리됩니다.

시그니처

api.replace_reference(slot: int, new_file: str) -> dict

파라미터

파라미터 타입 설명
slot int 교체할 슬롯 번호 (0–9)
new_file str .max 파일의 절대 경로

반환값

{
    "success": True,
    "message": str,
    "slot": int,
}

예외

예외 조건
FileNotFoundError 파일이 디스크에 존재하지 않을 때
ValueError 슬롯이 유효하지 않거나 비어 있을 때

예제

import sys, os, pymxs
_p = os.path.join(pymxs.runtime.getDir(pymxs.runtime.Name("userScripts")), "os_fast_ref_package")
if _p not in sys.path: sys.path.append(_p)

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'])

💬

Need help with the API?

Open a support ticket or join the community discussion.

Contact Support