Viz Commands Manual中文版

VizCommands 文档

更新:

2020-08-17 更新了获取中层场景名字、UUID的方法

基础介绍

Viz 可以根据Config / Communication 定义的端口(默认为6100)接收并处理viz Commands.

使用Viz console测试命令的话请加上‘send’前缀,大小写敏感:

send MAIN VERSION
CONSOLE:  answer <Version: 3.6.1.31596>

Viz Command结构

下面列出通用的Viz Command架构:

返回值标记

Viz command前面加上0或者大于0的前缀标记表示需要返回值(字符型),-1或者小于-1表示不需要返回值.

Viz Layers

Viz 场景可以加载到三个层: Back layer,middle layer andfront layer. .

针对某个层级的命令如下,依次为中层,前层,背景层:

 RENDERER 
 RENDERER*FRONT_LAYER 
 RENDERER*BACK_LAYER 

或者通过场景名字直接进行控制: SCENE*SceneName

Control Channels

Control channels 提供了一种快速定位container而且不用考虑其现在及之后所处的场景树位置的方法,其于container的链接在创建control channel时已经绑定,详细可以参考原来这就是Control Channels

Control channel 命名:

  • @ControlName. For example: @Node1Control.

使用惯例

请注意VIZ命令大小写敏感,下面这些命名分别表示不同的定义:DirName,dirName,dirname 和DIRNAME.

下面列出本文档即将用到的名词对应的内容:

            - The viz scene name(场景名). 
                         Example:  SCENE*Election_2001is/2_countd

         - The Viz node, full hierarchy(container的所处的场景树位置,用美元符号间隔,Controlchannel的话直接加@符号).  
                         Example: $all$base$kerne 
                       - Or Control Channel name 
                         Example: @ControlChannelName

              - The Viz node number(组(container)id).  
                         Example: #407 

         - The Viz directory name(文件夹或项目名). 
                         Example:  Dir1

            - The S2V number starting from 0 to 9.
                         Example:  2

                - The number indicating something to be either on (1) or off(0).
                         Example: 0

            - The Stop/Tag point name. 
                         Example:  $PointName

         - The Key frame name. 
                         Example:  $Keyframe1

          - The Key frame number. 
                         Example:  #234

         - The camera number from 1 to 16.
                         Example:  1

       - The values of the Key frame. 
                         Example:  10.0 20.0 30.0

  - Image name and path.
                         Example:  k:\arkiv\db_bilder1\cisco.rgb

 <Viz Image Path>      - Image name and path from viz. 
                         Example: IMAGE*dir1/image1

           - The viz plugin name(插件名).
                         Example:  TreeStatus

      - The viz plugin parameter name(插件属性名).
                         Example:  command

 <VizPluginButtonName> - The viz plugin button name.
                         Example:  initialize

    - The action channel name
                         Example :MyAction  

 <VizTime>            - Viz time in seconds  
                         Example :30.3
                       or  
                      - Viz time in frames  
                         Example :F19

 

 

VizCommands

请注意每条Viz Cmds前面都有一个数字前缀,所以跟GET有关的命令必须是0或者整数,这表示你需要返回值,否则的话你可以什么也GET不到。

场景相关的commands

 * Get all the viz scenes tree(获取Viz GH的目录结构)           : SCENE GET_ALL_GROUPS
 * Get the loaded scene in the renderer(获取当前加载的场景的VizID(不是场景的UUID))  : RENDERER GET_OBJECT
 * Set Scene in renderer, load if
   necessary  (加载场景)                           : RENDERER SET_OBJECT SCENE*
 * Load Scene to the memory(加载场景到内存)              : SCENE* LOAD

场景树相关的commands

 * Get Scene Tree(获取场景树的层级结构)                  : RENDERER*TREE GET
 * Get the Control Channels        : RENDERER*TREE*CONTROL_CHANNEL GET
 * Get Visibility Status           : RENDERER*TREE**ACTIVE GET
 * Change Visibility Status (俗话说就是打开或关闭眼睛,关闭SET 0,打开 SET 1)        : RENDERER*TREE**ACTIVE SET 
 * Get Obstruction/Key Status      : RENDERER*TREE**KEY GET
 * Change Obstruction/Key Status   : RENDERER*TREE**KEY*DRAW_KEY SET 
 * Get Text string                 : RENDERER*TREE**GEOM*TEXT GET
 * Change Text string  (获取文字内容)            : RENDERER*TREE**GEOM*TEXT SET 
 * Get Name of Image               : RENDERER*TREE**TEXTURE*DATA GET
 * Set Image name                  : RENDERER*TREE**TEXTURE*IMAGE SET 
   or                                RENDERER*TREE**TEXTURE*IMAGE SET <Viz Image Path>
 * Change Transformation - Position: RENDERER*TREE**TRANSFORMATION*POSITION SET   
 * Change Transformation - Rotation: RENDERER*TREE**TRANSFORMAT ION*ROTATION SET   
 * Change Transformation - Scaling : RENDERER*TREE**TRANSFORMATION*SCALING SET   

注意:针对下面的调整材质球参数的命令,他们的值范围是0-1(例如0.73 或1),你需要把0-255对应成0-1的值。

 * Change Material Ambient : RENDERER*TREE**MATERIAL*AMBIENT SET   
 * Change Material Specular: RENDERER*TREE**MATERIAL*SPECULAR SET   
 * Change Material Diffuse : RENDERER*TREE**MATERIAL*DIFFUSE SET   
 * Change Material Emission: RENDERER*TREE**MATERIAL*EMISSION SET   

选取和Bounding box相关的命令

 * Show or hide the bounding box                  : RENDERER SHOW_BOUNDING_BOX 
 * And then for a specific node                   : RENDERER*EDITED_OBJECT SET SCENE**TREE*
 * The x,y,z coordinates and extents for a node   : RENDERER*TREE**BOUNDING_BOX GET
 * To show the bounding box                       : RENDERER SHOW_BOUNDING_BOX 1
 * To set which bounding box is shown             : RENDERER*EDITED_OBJECT SET 
   If  is empty, no bounding box is shown.
 * Getting the picked object while clicking
   at certain screen position                     : RENDERER DROP                   
   The answer to this command will be 
                  SCENE**TREE*#
* The same as the previous one, but working also
  for merged objects                              : RENDERER DROPIN  
  The answer to this command will be 
                  SCENE**TREE*#*GEOM*TREE*#...      

If you want to set the bounding box you have to show it first! (RENDERER REDRAW should work.)

Key related commands

Show or hide the Key: RENDERER SET_KEY 

动画相关的commands

针对所有动画的命令:

 * Get Director Structures(获取director目录)          : RENDERER*STAGE*ANIMATION GET_DIRECTOR_DATA
 * Get Directors Names(获取director的名字)              : RENDERER*STAGE*DIRECTOR GET
 * Start all directors(开始所有动画)     : RENDERER*STAGE START
 * Stop all directors  (停止所有动画)             : RENDERER*STAGE STOP
 * Continue all directors (继续所有动画)          : RENDERER*STAGE CONTINUE
 * Continue reverse all directors  
(反向播放所有动画)
: RENDERER*STAGE CONTINUE REVERSE * All director go to beginning : RENDERER*STAGE SHOW BEGIN or (所有动画回到第一帧) : RENDERER*STAGE SHOW 0.0 * Continue/run all director without stopping at stop points :
(开始所有动画,并且忽略所有STOP点)
RENDERER*STAGE START_NOSTOP * Continue all director without stopping at stop points: (继续所有动画,并且忽略所有STOP点) RENDERER*STAGE CONTINUE_NOSTOP

针对特定动画directors的命令

下面的命令跟上面的针对所有动画的类似,不同的在于上面的命令不能指定要控制的动画,而是针对stage里面的所有动画,举例来说你想开始Director名字为MOVE的动画,那么你需要写:RENDERER*STAGE*DIRECTOR*MOVE START

 * Add a director                   : RENDERER*STAGE ADD 
 * Get data of a specific director  : RENDERER*STAGE*DIRECTOR**DATA GET
 * Get stop/tag points data of a specific director  
                                    : RENDERER*STAGE*DIRECTOR**EVENT GET
 * Start director                   : RENDERER*STAGE*DIRECTOR* START
 * Stop  director                   : RENDERER*STAGE*DIRECTOR* STOP
 * Continue  director               : RENDERER*STAGE*DIRECTOR* CONTINUE
 * Continue reverse  director       : RENDERER*STAGE*DIRECTOR* CONTINUE REVERSE
 * Set one director to beginning    : RENDERER*STAGE*DIRECTOR* SHOW BEGIN
   or                                 RENDERER*STAGE*DIRECTOR* SHOW 0.0
 * Move director to tag/stop point  : RENDERER*STAGE*DIRECTOR* SHOW 
 * Get the End Time of an animation : RENDERER*STAGE*DIRECTOR**END_TIME GET
 * Get the StartTime of an animation: RENDERER*STAGE*DIRECTOR**START_TIME GET
 * Get director status data         : RENDERER*STAGE*DIRECTOR* GET_STATUS
 * Get only director status         : RENDERER*STAGE*DIRECTOR* GET_TIMELINE
 * Start/run director without stopping at stop points: 
                                      RENDERER*STAGE*DIRECTOR* START_NOSTOP
 * Continue/run director without stopping at stop points: 
                                      RENDERER*STAGE*DIRECTOR* CONTINUE_NOSTOP
 * Continue Director but ignore the first stop point that follows :
                                      RENDERER*STAGE*DIRECTOR* CONTINUE_IGNORE_NEXT_STOP


 * Copy Animation to a specific director :
                                   RENDERER*STAGE*DIRECTOR**OBJECT SET 

animation action channel commands

 * Define an action                 : RENDERER*STAGE*DIRECTOR**ACTION ADD 
 * Define an action keyframe        : RENDERER*STAGE*DIRECTOR**ACTION* ADD 
 * Change value of an action key frame :                                  
                         RENDERER*STAGE*DIRECTOR**ACTION**KEY**VALUE SET 

Stop / Tag points commands

 * Add stop point    : RENDERER*STAGE*DIRECTOR**EVENT ADD  STOP 
 * Move a stop point : RENDERER*STAGE*DIRECTOR**EVENT*KEY**TIME SET <VizTime>
   or
                     : RENDERER*STAGE*DIRECTOR**KEY**TIME SET <VizTime>

change the Length of a Pause Point :RENDERER*STAGE*DIRECTOR**KEY**PAUSE_LENGTH SET <VizTimeInDeconds>


key frames commands

 * Command to add the channel if it does not exist ( needed for some channels types )
                      : RENDERER*TREE**ANIMATION*KEY UPDATE 1
 * Command to change the value of a key frame 
                      : RENDERER*TREE**ANIMATION*KEY*$*VALUE SET 
                      : RENDERER*TREE**ALPHA*ANIMATION*ALPHA**VALUE SET 
 * Add position key frame   : RENDERER*TREE**TRANSFORMATION*POSITION*ANIMATION*POSITION ADD <VizTime>
 * Add position key frame with name (starting viz version 2.7pl2)
       : RENDERER*TREE**TRANSFORMATION*POSITION*ANIMATION*POSITION ADD <VizTime> 

 * Add scaling key frame    : RENDERER*TREE**TRANSFORMATION*SCALING*ANIMATION*SCALING ADD <VizTime>
 * Add visibility key frame : RENDERER*TREE**ANIMATION*VISIBLE ADD <VizTime>
 * Add alpha key frame      : RENDERER*TREE**ALPHA*ANIMATION*ALPHA ADD <VizTime>
 * Change the name of a key frame : RENDERER*TREE**ANIMATION*KEY**NAME SET 
 * Set time to a key frame  :  RENDERER*TREE**ANIMATION*KEY**TIME SET <VizTime>

 * Add a GEOM key frame require two operations :
                                    RENDERER*TREE**GEOM* SET <VizTime>
                                    RENDERER*TREE**ANIMATION*KEY UPDATE <VizTime>
 * Add a function key frame : RENDERER*TREE**FUNCTION**ANIMATION* ADD <VizTime>
 * Add GEOM key frame       : RENDERER*TREE**GEOM*ANIMATION* ADD <vizTime>

Camera related commands

 * Get Current Camera   : RENDERER*CURRENT_CAMERA GET
 * Change Camera        : RENDERER SET_CAMERA  1
                          ( use THIS_EDITOR in order to change the camera using action key frame )
 * Add FRONT_LAYER or BACK_LAYER to each command to get or set to these layers - i.e.
                          RENDERER*CURRENT_CAMERA GET FRONT_LAYER
 * Change camera to Perspective or Orthographic :
                          RENDERER**VIEW SET PERSPECTIVE 
                                 ( i.e. RENDERER*CAMERA1*VIEW SET PERSPECTIVE )
                          RENDERER**VIEW SET ORTHOGONAL
                                 ( i.e. RENDERER*CAMERA1*VIEW SET ORTHOGONAL )
 * Setting the Frustum of an Orthograophic camera
                          RENDERER**FRUSTUM SET    
                                 ( i.e. RENDERER*CAMERA2*FRUSTUM SET -100 100 -100 100 )
 

S2V related commands

 * S2V - get status and Name: RENDERER*S2V* GET
 * Get Cureent S2V          : RENDERER*S2V*INDEX GET
 * Change current S2V       : RENDERER*S2V*INDEX SET 

内存清空命令

 * Clean up the images memory(图片内存清空): IMAGE CLEANUP
 * Clean up the fonts memory (文字内存清空): FONT CLEANUP
 * Clean up the scenes memory(场景内存清空): SCENE CLEANUP
 * Which scenes are loaded  (加载了哪些场景) : SCENE INFO
 * Which images are loaded   (加载了哪些图片): IMAGE INFO

注意:当你发送IMAGE CLEANUP时,Viz不会清空texture,可以用IMAGE INFO查看加载了哪些图片。

初始化相关的命令

 * to force viz to allocate the memory for textures in the renderer , 
   this will create all display lists for plugins, build text objects, define textures..... :
                   RENDERER INITIALIZE
 * To initialize automatically use:
                   RENDERER*UPDATE SET 0
                   RENDERER*UPDATE SET 1

 * Force a scene to be reloaded 
  (Note that you have to use SET_OBJECT in order to load this scene to the renderer :
                   RELOAD

插件相关的命令

 * Calling Viz Scene plugin parameter: (设置场景插件的参数)
                   RENDERER*FUNCTION** SET 

 * "Virtual" press on viz scene plugin button: (触发场景插件的按钮)
                   RENDERER*FUNCTION**<VizPluginButtonName> INVOKE

 * Calling Viz container plugin parameter: (设置function插件的例子)
                   RENDERER*TREE**FUNCTION** SET 

 * "Virtual"press on viz container plugin button:(触发function插件的按钮)
                   RENDERER*TREE**FUNCTION**<VizPluginButtonName> INVOKE

 * To get the interface of a function plugin: (获取funciton插件的参数)
                   BUILT_IN*FUNCTION**PARAMETER GET

 * To get the interface of a geom plugin: (获取Geom插件的参数)
                   BUILT_IN*GEOM**PARAMETER GET
 * To set the value of graph points on the praph object:
                   RENDERER*TREE*Graph*X SET  
                   RENDERER*TREE*Graph*Y SET  

Trio相关命令(此条命令非常好用,用于以切换逻辑的方式控制动画)

 * To run transition from one specific stop point to another(按照格式填入动画名和stop点名字,例如:
RENDERER*STAGE*DIRECTOR*Director名字 GOTO_TRIO $A $B
): RENDERER*STAGE*DIRECTOR* GOTO_TRIO $ $

Targa 3200 commands

 * To set clip to a codec channel:  THIS_SCENE*STAGE*DIRECTOR**TARGA3200*2*KEY*$*CLIPNAME SET 
 * To set a clip to a codec channel as DVE:  RENDERER*TARGA3200*CHANNEL*3*CLIP_NAME SET C:\clipname.avi
 * To play the clip on the codec channel:   RENDERER*TARGA3200*CHANNEL*3*CLIP_CONTROL PLAY 

Other Commands

 * Get the used memory and total texture memory: MAIN*SYSTEM*TEXTURE_MEMORY_INFO GET
        The answer is the maximum amount of texture memory of the system and the amount of memory available
 * Show how much memory is used :  TEXTURE_MEMORY_INFO GET ( not how much texture memory is available !)
 * Show console window: MAIN SHOW_COMMANDS ON
 * Set viz|artist in control-mode (onair-mode): MAIN SWITCH_EXTERNAL ON
 * Get license information: @KEY GET INFO
 * Set license key: @KEY SET 
 * Force an immediate redraw: RENDERER REDRAW
 * Get snapshot from viz :RENDERER SNAPSHOT   [  ]
   (width and height are optional. send them only if you want a high resolution snapshot) 

ViewPorts Commands

 * Setting the mask of a view port :
                   RENDERER*WINDOW*VIEWPORT**VIEWPORT_MASK SET 
                   ( i.e. RENDERER*WINDOW*VIEWPORT*0*VIEWPORT_MASK SET 0x1 )
 * Setting the clear color of a view port :
                   RENDERER*WINDOW*VIEWPORT**CLEAR_COLOR SET    
                   ( i.e. RENDERER*WINDOW*VIEWPORT*1*CLEAR_COLOR SET 0.5 0.0 0.0 1.0 )
 * Setting the camera of a view port :
                   RENDERER*WINDOW*VIEWPORT**CAMERA SET 
                   ( i.e. RENDERER*WINDOW*VIEWPORT*2*CAMERA SET 3 )
 * Setting "all attributes" of a view port :
                   RENDERER*WINDOW*VIEWPORT**SET_ALL_ATTRIBUTES      
                   ( i.e. RENDERER*WINDOW*VIEWPORT*0 SET_ALL_ATTRIBUTES 0 0 400 300 1 1 )

Device and Post Rendering Commands

 * Getting available devices: DEVICE*DATA GET
 * Setting recording parameters:
     RENDERER*POST*START SET 
     RENDERER*POST*END SET 
     RENDERER*POST*DEVICE SET DEVICE*
     RENDERER*POST*NAME SET 
 * Start recording: RENDERER*POST RECORD
 * Get recording status: RENDERER*POST*STATUS GET
 * Stop recording: RENDERER*POST STOP_RECORDING

Audio

RENDERER*AUDIO*CHANNEL*channel*AUDIO_VOLUME SET volume

  • channel: Integer value identifying audio channel.

  • volume: Number in the range [0, 100].

小提示

  • 在Viz CMDs里面THIS_SCENE和RENDERER的作用类似,或者你可以用场景的路径代替SCENE*scenename,但是这样的话一旦场景路径发生变化的话就比较麻烦了,例如:

    THIS_SCENE*TREE**ACTIVE SET 0
  • 在更改摄像机的时候你可以用THIS_EDITOR来代替上面的THIS_SCENE等, 例如你想在某一个Actionkeyframe更换摄像机:

    THIS_EDITOR SET_CAMERA 2 1

    但是不能这么写 EDITOR*1 SET_CAMERA 2 1或 RENDERER SET_CAMERA 2 1.

如何用Viz CMDs的方式升级权限

点击Viz Artist右上角的“i”按钮,或者按SHIFT+INS可以打开权限文件的注册窗口,然后把权限粘贴进去,但是有些情况下由于分辨率或者其它缘故看不到这个按钮就比较麻烦了(其实这种情况比较少见了,下面的方法主要是装B用。)。现在提供用Viz CMDs的方式进行注册,可以参考下面的格式。

send @KEY SET C1 7F 8C 01 40 21 81 09 E4 E4 3C 1B 6D D5 49 FF AA dd 4B 31 3C 8C E5 rr 40 C1 6F 3C E5 E5 4C 7C
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值