Fast Ref / API Reference / Core

check_file_status()

각 레퍼런스의 소스 파일이 최신인지, 변경됐는지, 없어졌는지 확인합니다.

시그니처

api.check_file_status() -> dict

반환값

{
    "success": True,
    "data": [
        {
            "name": str,        # 레퍼런스 이름
            "file_path": str,   # 소스 파일 경로
            "status": str,      # 아래 상태값 참고
        },
        ...
    ]
}

상태값 (status)

의미
"latest" 소스 파일이 마지막 로드 이후 변경되지 않음
"outdated" 소스 파일이 마지막 로드 이후 수정됨
"missing" 소스 파일이 디스크에 없음
"converted" 레퍼런스가 씬 오브젝트로 변환됨 (소스 파일 없음)
"unknown" 상태를 확인할 수 없음

예제

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()
status = api.check_file_status()

for s in status['data']:
    print(f"  {s['name']}: {s['status']}")

활용 예 — 변경된 파일만 리로드

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()
status = api.check_file_status()

if any(s['status'] == 'outdated' for s in status['data']):
    result = api.reload_all_references()
    print(result['message'])
💬

Need help with the API?

Open a support ticket or join the community discussion.

Contact Support