Tutorials

How to pad digits in Javascript

- There are many ways to accomplish this in js but the following is the one I found to be the best: Let’s say you need to pad a number with leading zeros so the total digits of the number will be 5, simply do a: var pad = String('0000'+n).slice(-5); n is the number to be padded. [ credit goes to http://gugod.org/2007/09/padding-zero-in-...

TACTIC MAKO - Setup a bar graph

-     VERSION 2.6.0.b05+   In the following tutorial, we will use the MAKO templating engine to setup a custom bar graph view. This tutorial leverages the...

Table View Button to Execute Triangle Count in Maya Session

-   Overview This tutorial walks you through an example of creating a button column widget in a table view that will execute commands in a Maya session to obtain the triangle count for a given asset (if that asset is in your Maya session).   For the purposes of this tutorial, the "sample3d" example project will be used.   Requirements TACTIC 3.0.0.v02 (or...

How to use the Script Editor to do simple query

-     Whether you just need some quick information or you try to embed some behaviors in a button in your Custom Layout, the Client API can be used in javascript mode. Here is a snippet of code which can be run in the TACTIC Script Editor:   To retrieve the notes for shots with an id of 10 and search type containing the word 'shot':  ...

How to write a python trigger in TACTIC Script Editor

-   This trigger enters a new note based on the publish description of a new check-in. It can be any check-in like the one executed in the General Check-in widget or Asset Checkin under Applications. Since it is written in the Script Editor, it does not require a server restart to implement it.   1. Add an entry into the Triggers page   event      ...

How to define a new entry in the gear menu

-     In the widget_config table you can insert the following entry to add to the table gear menu.   eg:   search type...

How to get the 'search criteria' that the user typed in

-   How to get the 'search criteria' that the user typed in: Take a look in the following file for the method: File src/context/spt_js/dg_table.js Method spt.dg_table.get_search_values() First, we need to get the table:     var top = table.getParent(".spt_view_panel");     search_wdg = top.getElement(".spt_search...

Run a python command through a click event in the browser

-   In a custom layout widget or button widget, you can add behavior to an HtmlElement so that it can execute a Python command stored in the server or Script Editor. Here is an examaple of how how to do it with a server Python command.     1. A widget is defined with a simple button displayed:             from pyasm.web import DivWdg from...

Clearing the Cached Memory on Linux

-   sync; echo 3 > /proc/sys/vm/drop_caches

Check if Java plugin is installed?

-   At the following location, click the "Do I have Java?" Link http://www.java.com/en/download/index.jsp

Installing Java in Linux 64bit Firefox

- The following steps can be used to install the Java plugin on Linux based 64-bit Firefox.   First, download the latest java 6.024 installer from java.com and install it in /usr/java #!/bin/csh mkdir /usr/lib64/firefox-3.6/plugins cd /usr/lib64/firefox-3.6/plugins ln -s /usr/java/latest/lib/amd64/libnpjp2.so alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin....

Load a mov into Quicktime with a button.

-     In this example, a button will be configured to run a script which will use the Java Applet to call a script to load quicktime on the local (client) computer. The button that will be setup for this example can be placed in any view.  Create the new Button in your view with the following options Name quicktime_test_button Path test/...

Load a mov into Quicktime with a button.

-     In this example, a button will be configured to run a script which will use the Java Applet to call a script to load quicktime on the local (client) computer. The button that will be setup for this example can be placed in any view.  Create the new Button in your view with the following options Name quicktime_test_button Path test/...

Run a local script with a button

-   In this example, a button will be configured to run a script which will use the Java Applet to call a script with arguments on the local (client) computer. The button that will be setup for this example can be placed in any view.  Create the new Button in your view with the following options Name test_button Path test/execute_local_script_test...

Setup Simple search views

-   Simple Search Views can be setup which provide simple, intuitive search interfaces for end-users. The following example sets up some simple filters in a shot view in our DI demo project...

How to increase maximum database connections

Note: if you encounter max_locks_per_transaction error, this tutorial applies as well except you have to adjust max_locks_per_transaction and shared_buffers settings. -               The standard 100 max database connections the TACTIC server can have with the database server may not be enough for production use. To increase this Postgres default in a Linux setup, you...

Qube integration JS examples

-     This tutorial aims to provide examples geared towards connecting Tactic to Qube.  The main goal is job submission directly from Tactic where required input...

Example JS API - Get selected in tables

- The following Custom Layout example shows how the selected items in Table Widgets can be retrieved.  The challenge in this case is to have 2 tables in the same view and retrieve the selected in each of the tables.  This applies to a situation where you need to create associations between sObjects for planning, reservations etc. The main Javascript function of focus in this example is the following...

Dump Table to CSV from commandline

-     The following command can be used in the postgres shell to dump a table out to a .csv file. COPY <TABLE NAME> to '<FILE PATH>' delimiters',' CSV HEADER; For Example psql -U postgres sthpw COPY snapshot to '/spt/tactic/test.csv' delimiters',' CSV HEADER;  

Pipeline Colors

-     There are 2 levels of color in pipelines.  This example has pipelines setup with the following hierarchy: Pipeline Process Status...

Pages