terragen_rpcモジュールは、Terragenにリモートプロシージャコールを行うためのPython APIを提供します。TCPソケットやJSON-RPCプロトコルを意識することなくコードを記述できる、高レベルなラッパーを意図しています。
使用例:
import terragen_rpc as tg
# プロジェクトのトップレベルのノードをプリントする
project = tg.root() children = project.children() for c in children: print(c.path())
# パスが "/Render Camera" であるノードのパラメータを表示する
camera = tg.node_by_path('/Render Camera') if camera: print(camera.param_names()) else: print("Node not found")
# 注: この例では、簡潔にするために例外処理を省略しています。 # 例外処理については他の例を参照して下さい。 |
注:
例外処理の詳細については、[[Exceptions/Errors]]を参照して下さい。
Module: terragen_rpc
更新履歴
- 0.9.0:
- クラスNodeはノードIDをstrに置き換えました。
- Nodeにメンバ関数を追加:
name,path,parent_path,parent,children,children_filtered_by_class,param_names,get_param_as_string,get_param_as_int,get_param_as_float,get_param_as_tuple,get_param_as_list,set_param,set_param_from_string
- 削除されたフリー関数:
get_param_as_int,get_param_as_float,get_param_as_tuple,get_param_as_list, set_param
- 非推奨のフリー関数:
name,path,parent_path,parent,children, children_filtered_by_class,param_names,get_param_as_string,set_param_as_string,toggle_enable_node
最終更新:2023年07月05日 15:51