opengl:maya_shaderfx
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
opengl:maya_shaderfx [2014/04/22 22:35] – [Data Access] oga | opengl:maya_shaderfx [2014/04/23 01:03] – [Data Access] oga | ||
---|---|---|---|
行 31: | 行 31: | ||
+ | |||
+ | ===== Advanced Mode ===== | ||
===== Data Access ===== | ===== Data Access ===== | ||
- | 内部情報にアクセスするためには shaderfx コマンドを使用します。 | + | ShaderFX |
+ | 内部の情報を読み出すプログラム。 | ||
< | < | ||
+ | // ShaderFX の内部情報取得 | ||
+ | |||
global proc a7ListShaderFx() | global proc a7ListShaderFx() | ||
{ | { | ||
行 44: | 行 48: | ||
int $count= `shaderfx -sfxnode $node_name -getNodeCount`; | int $count= `shaderfx -sfxnode $node_name -getNodeCount`; | ||
+ | int $root= `shaderfx -sfxnode $node_name -getHwShaderNodeRootGrpID`; | ||
+ | int $hwnode= `shaderfx -sfxnode $node_name -getHwShaderNodeID`; | ||
print ( " | print ( " | ||
+ | print ( " | ||
+ | print ( " | ||
string | string | ||
- | int $i; | + | int $ni; |
- | for( $i= 0 ; $i< $count ; $i++ ){ | + | for( $ni= 0 ; $ni< $count ; $ni++ ){ |
- | int $uid= `shaderfx -sfxnode $node_name -getNodeUIDFromIndex $i`; | + | int $uid= `shaderfx -sfxnode $node_name -getNodeUIDFromIndex $ni`; |
string | string | ||
string | string | ||
行 58: | 行 66: | ||
print "group start {\n"; | print "group start {\n"; | ||
$indent= " | $indent= " | ||
- | //int $gid= `shaderfx -sfxnode $node_name -getGroupUID $uid`; | ||
} | } | ||
if( `shaderfx -sfxnode $node_name -isGroupEnd $uid` ){ | if( `shaderfx -sfxnode $node_name -isGroupEnd $uid` ){ | ||
行 69: | 行 76: | ||
print ( $indent + $uid + ": <" + $class_name + "> " + $name + " " + $flag + " | print ( $indent + $uid + ": <" + $class_name + "> " + $name + " " + $flag + " | ||
+ | // Properties | ||
string | string | ||
for( $prop_name in $prop_list ){ | for( $prop_name in $prop_list ){ | ||
string | string | ||
- | |||
switch( $prop_type ){ | switch( $prop_type ){ | ||
case " | case " | ||
- | print ( $indent + " | + | print ( $indent + " |
break; | break; | ||
case " | case " | ||
行 93: | 行 100: | ||
} | } | ||
+ | // Sockets | ||
+ | int $socket_type; | ||
+ | for( $socket_type= 0 ; $socket_type < 2 ; $socket_type++ ){ | ||
+ | int $socket_count= `shaderfx -sfxnode $node_name -getSocketCount $uid $socket_type`; | ||
+ | int $si; | ||
+ | if( $socket_count != 0 ){ | ||
+ | switch( $socket_type ){ | ||
+ | case 0: print ( $indent + " | ||
+ | case 1: print ( $indent + " | ||
+ | } | ||
+ | } | ||
+ | for( $si= 0 ; $si < $socket_count ; $si++ ){ | ||
+ | string $socket_name= `shaderfx -sfxnode $node_name -getSocketName $uid $socket_type $si`; | ||
+ | string $socket_stype= `shaderfx -sfxnode $node_name -getSocketType $uid $socket_type $si`; | ||
+ | int $connected_count= `shaderfx -sfxnode $node_name -getConnectedSocketCount $uid $socket_type $si`; | ||
+ | print ( $indent + " | ||
+ | int $ci; | ||
+ | for( $ci= 0 ; $ci < $connected_count ; $ci++ ){ | ||
+ | string $connected_node= `shaderfx -sfxnode $node_name -getConnectedNodeID $uid $socket_type $si $ci false`; | ||
+ | string $connected_id= `shaderfx -sfxnode $node_name -getConnectedSocketIndex $uid $socket_type $si $ci false`; | ||
+ | print ( $indent + " | ||
+ | } | ||
+ | } | ||
+ | } | ||
if( `shaderfx -sfxnode $node_name -isGroupEnd $uid` ){ | if( `shaderfx -sfxnode $node_name -isGroupEnd $uid` ){ | ||
行 102: | 行 132: | ||
} | } | ||
- | |||
</ | </ | ||
opengl/maya_shaderfx.txt · 最終更新: 2014/04/23 01:06 by oga