Basic tutorial (Node-network editing with OpenAssembler)

•November 29, 2009 • Leave a Comment

In this post I would like to present you a very easy setup/tutorial for oas, to demonstrate the basic concept behind the system.

So: This tutorial is about to produce a really light example, we will produce an application with user-interface to add two numbers and display the result. (I told you it is a basic one.. :))

What you will need is OpenAssembler installed with all the requirements, and a basic knowledge in QT Designer. (of course medium level python as well…)

We will start to build up the interface in qt4-designer. I consider you know designer better than me, so I do not really want to dive into details on this step, rather I just summarize the requirements.

Step1: construct a window in qt4-designer which is similar to the one you see on the first picture. Please use “Line Edit” element for the inputs, and a “Tool Button” for the “=” button. (I used simple “Label” and the basic layouting tools as well.)

Step2: set up the names of our objects in designer. Call the first input “inA” the secound “inB” the output “outAB” and the “=” button as “eq_but”. This is an important step, this names will identify your gui-elements in OpenAssembler.

Step3: save the window template somewhere, lets say to your user folder: ~/window.ui.

Step4: we are done in the designer for now, you can start oas. (you can “cd” to the folder where oas is and then start “./oas” or “./oas -gl” depending on if you have opengl setted up or not, or maybe the best way to create an alias in you bashrc for it. ) At this step I consider you have oas fully installed and working. So, start oas now… We will use the following keyboard/mouse shortcuts:

  • Right click: opens up the menu with the nodelist
  • Double click: displays the settings of your node you clicked on
  • Right click on node: node popup menu
  • Right click on slot: disconnect menu
  • “a”: frames all nodes
  • “f”: frames selected nodes
  • “+”, “-“: zoom in and zoom out
  • “g”: switch selector/pan mode (TRY IT!)
  • Press space: to switch to full-window editor layout

Step5: right click on the node-editor panel, from the menu, go to “OpenAssembler Core” and select “_def” (like on the secound picture). It will place you down a _def node, this is very similar to pythons definition (def (): …).

Step6: Like in every object-oriented python script you have to have a definition to start the application with. We call it “__init__” this will be our point to start the application. So rename your node to “__init__”. You can do it by double clicking on the node you just taken, it will open it up in the attribute editor. At the top of the attribute editor you will something like: “_def748366” this is the actual name of your node, clean it and name it to “__init__”. In every oas script you have to have 1 and only one “__init__” node (from “_def” type). If you do not have “__init__” your script will not run at all.

Step7: double click again on your node, and you will see a new line appeared in the attribute editor, “QTMainWindowUI”. (3rd picture) Point this to your previously saved .ui file by filling out this attribute value. (4th picture) If you press RUN on the top button bar you supposed to see your window pop up if no, you failed on some step, please check and re-check again. If it is still not working drop me a line. While your uder-development window is open (by pressing the RUN) oas stops, so do not affraid of the fact looks like frozen, well it is not.

Step8: (from this point I consider you succed the previous step, and you get your window running) now put down an empty node, you can find it in the PyModules category (picture 5) You can rename this node to “collector” or something like this, but it is just optional. We will use this node to gather other nodes/node-networks in to the “__init__” definition.

Step9: now you have to connect this new node to the “__init__” into the “Input” slot. To do this you have to hold down the shift key and click-hold-move from the node output to the targetnodes input then release. I hope it was working for you. If yes you will see a connection line betwean this two, and all the included slot become green which means it is connected.

Step10: put down an “init_LineEntry” node from the “QtModules” menu section, and connect its output to the input “in01” on the node we call “collector”. This is cool. This init node will initialize your line entry object in your .ui file. At this stage you have to point this node to the ui-element you want to connect with. so..

Step11: put down an “in_out” node from the “PyModules” section, double click on it, and edit the “_in” parameter to point it to your “inA” ui element. So write into the parameter that: “>inA” and press enter! (this is important to press enter every time you modify a parameter). This will tell oas, that you are pointing to a class named “inA” (self.inA). Now optionally rename this node to something like “_inA_” for a better identification. Now connect this nodes out to the “Entry” input of the “init_LineEntry” node. This means the “in_out” node is now pointing to the “inA” gui element and you add this value further for the “init_LineEntry”, so now this is now driving the gui element you created earlyer in qt4-designer. Of course you can write “>inA” directly into the “init_LineEntry” — “Entry” input, and it will work the same way, but later on it will be usefull to connect this “in_out” everywhere you vant to do somathing with “inA” gui element. Now your network looks like the one on this picture:

Step12: now repeat step10 and step11 two more times, and point them to “inB” and “outAB”. That is nice, but you can not connect them to the “collector” because all of its input is full, you have to create a new input!!

Step13: click on the orange “+” icon next to you node’s bottom left corner.  A popup window will appear asking for the inputs name, lest call it “in02” and press ok, the next popup woll ask you about the type of your input, at this time write there “any” and press ok. If you did everything allright a new imput slot must appear called “in02” and in the slot’s handler there is a white triangel. This means you created an “any” slot. If it is now white, you can delete the slot by right-click on it, and select delete, and re-do the step and make sure you set the node type to “any”. Now if you create a third slot aswell, than you will be able to connect all the “init_LineEntry” into your “collector”.  At this point you can create the 4th one as well, and that is all we will need for this tutorial but of course you can create unlimited number of slot for a node.

Step14: put down an “init_Button” and set it up with an “in_out” pointing to the “>eq_but”. Connect this one to the “collector” as well. Now you have to see the following as me:

Step15: now it is time to save your work. Press the “Save” or the “SaveAs” button, and save your script somewhere named for examples like: tutorial01.oas

Step16: Now it is the time to do the script working. Well for this you need to make a new definition by adding a “_def” node. Name it lets say: “addthem” This will be a new definition in your oas script (just like you use it in python) Well, what we are doing here is: we make a dfinition/call which is used every time when the “=” button is pressed in your window. So, you need to register your definition in your button initialization script, under the “clicked” parameter. Simply fill this parameter with this: “>addthem”. now you are pointing to the “addthem” function, and when the button is triggered it will fire your call off. (When you make a reference to a function or to anything your slot will change color to some yellowis one indicating that it is referenced.)

Step17: what we want to to is to collect the informations from the inputs, add them and then set the output to the resulted value. Put down 2 “get_LineEntry” for the “QtModules” section, connect the “Entry” inputs to the “in_out” nodes (“_inA_”,”_inB_”) output. Check the picture:

Step18: now put down a “multiMath” node from the “Math” category, this will be the one to use for adding the values. Now if you look it carefully you will see, that the triangle inside the slot-handlers are different colored on the “get_LineEntry” and on the “multiMath”. This is becaue the “get_LineEntry” outputs a string but the “multiMath” waits for a float (or int) input. You can not connect them. So what to do now? Put down 2 “in_out” because it has white triangles which means their type is: “any” and this is the type you can connect it everywhere. So in this case, we use them to convert the string to a float, and now you can input it to the “multiMath”. Make a similar connection like the one on the following picture:

Step19: well, we are almost there. Now we have the two value added to a math node, the last thing we wnat to do is to put down a “set_LineEntry” and connect the “Entry” input to the “in_out” called: “_outAB_”, put down an “in_out” again to convert the output of the math node then connect it to the “setText” input of the “set_LineEntry”. And finally connect the “set_LineEntry” “result” output to the “Input” slot of the “addthem” definition node. DONE! Save your work, and press the RUN. You have to see you window popping up, input some values, and add them togother. I hope it is working for you aswell!!! Please consider, that this really basic example will excude the fact that you can input string, letters, and anything. It is waiting for numerical inputs, and it will not check them.

Your final network have to be something like this:

And your final software:

Of cours you can run your software from outside of oas as well, I will explain later how you can generate python scripts from your oas files, or how you can include oas scripts into Nuke, Houdini, Maya, or enywhere you want.

I hope you enjoy working with oas, if you have any problem drop me  a mail.

Advertisements

Installation

•November 28, 2009 • Leave a Comment

It was long time ago I posted here, I had a lot to do at work.

At this time I will talk about how to install oas, and how to set it up.

At first, I suggest Linux to use Oas on of course it have to be working on any other platform, but I use/test it on linux. (some dude working with it on win, and it looks like working very well, but if I am informed well we have some problem on OSX, I do not see any big issue, so later on I will track this bug down and correct it)

So what you need to install oas?:

  • Python (prefered: 2.5x but must working any python above ver. 2.3)
  • PyQt4 (for development: full package including designer….)

That is all.

So, to install use subversion to get the latest version from googlecode:

Important: replace ~ everywhere with the correct path to your home folder ~ will not work!!!!!

If you are in your user folder, create a folder named Development (~/Development) then cd into there.

From the Development folder:

svn checkout http://openassembler.googlecode.com/svn/trunk/ OpenAssembler

Than it will download for you.

Ok, we are almost there, cd to ~/Development/Settings,

mkdir ~/.OpenAssembler (on win create a directory OpenAssembler into your home folder)

cp * ~/.OpenAssembler

For OpenAssembler only, edit the OpenAssembler.ini file for OpenProject and Openassembler togother edit booth file.

in OpenAssembler.ini —> edit the line “manulapath” to point it to your ~/Development/OpenAssembler/OpenNodes directory. this will allow oas to recognize the node-bank

in OpenProjectdb.ini —> edit all the lines to point them to your openporject root (I will explain it later and your dev folder to point it to ~/Development)

I think you are ready, now cd to ~/Development/OpenAssebler/OpenAssembler and type “./oas” or “./oas -gl” for opengl mode. Fingers crossed!! Your oas with the gui have to pop up now! If it is not working send me the error it drops and I will track it dow what is happening.

So what is in the package (the folders):

OpenAssembler -> it contains the core of openassembler absolutely independent form OpenProject and anything else, you can use for anything you want if you produce nodes for it.

OpenNodes -> the node-ban, it contains several node to start with most of them is connected to PyQt4, python itself and OpenProject (which an assetmanager system for vfx-type works, and it is a part of the complete oepnassembler package)

Settings -> contains the 2 setupfile for oas and opDb

Misc -> contains a text editor made by me (OpenTextEditor) it is a really simple texteditor, I enjoy to use it but it is really basic. I plan to integrate later to the oas gui, so you will have one interface for node development and the networking interface aswell. And also it contains a few template which is useful for renderfarm-job-distribution (it is connected to openproject, this is the sheme I use as a jobdescription file at most of the times.)

That is all, if you cd into the oas folder anf input the command: “svn up” it will get you the latest version of the software anytime.

I hope you enjoy time with oas, if you have any problem let me know!

Basic Node Editor Gui

•October 22, 2009 • 3 Comments

Screenshot-OpenAssembler-1In this post I would like to introduce the very basic features of the node editor gui. As you can see from the picture OpenAssembler’s node editor is structured into 5 different panel.

  • In the center, the darker gray one is the actual node editor. This is the place where you can place the nodes, you can connect them ,you can add new input connection slot to them and so on… In this section with the right mouse click you will get a menu with a list of the available nodes categorised into menucategories.If you right-click on a node you will get a short menu with the option to delete, duplicate (it have a bug at the moment so please avoid this one) and to set it as an end-node (I will explain it later, in the next posts) On the connection slot handler you have a right-click menu with the option to diskonnect and delete the connection with the underlying attribute.
  • At the top you have buttons for the most basic file operations and a search box. Take care!: OpenAssembler will not warn you before you quit, or you ask for a new session. Make sure you save your oas before you do so. With the green RUN button you can start your script in the case you have __init__ (_def node) placed.
  • In the right side you can find the attribute editor. No magic in it at all, you can rename your nodes and adjust the settings of it. If the little led is green, means you have input connection on that slot There is a switch named: cache, if your node is prepared for it you can switch the node to be cached. OpenAssembler have a common py-dictionary-based cache which is accessible thrue the nodes during the run-cycle. At this time you have a string ediotr for all the type of attributes, but later on I will write a proper input dialog for float, boolean, path, color, and so on… Important!!: You can not use ” just ‘ (the simple one!!) This is really important!! If you use the double oas will misunderstand your request and a part of the data on your node will be lost.
  • Under the attribute-editor you can find the console output. It is usefull to debug and have some feedback  on what is happening in the node-network.
  • In the buttom-left corner you have a timeline. Not really usefull at the moment, but you can access the current frame with an oas-expression during the run-cycle, and you can work with information to. Later I plan to implement some key-ing ability to oas, when it is ready, the timeline will have some real importance.

Some additional information: If you hit the space button in the node-editor panel, it will hide/unhide all the other panels. Also: you can start oas in OpenGl mode simply by starting it with “-gl” for example like this: “./oas -gl”

In the next posts I will introduce the most basic nodes currently come with oas, and I will write some about the installation too.

Basic Structure

•October 4, 2009 • Leave a Comment

In this post I will explain you more about the core structure of OpenAssembler.

OAS have 3 main part:

  • OpenAssembler Core
  • OpenAssembler Gui
  • OpenNodes

The core contains all te essential functions to be able to run and work with nodes, it is completly independent from any Gui. It has a console style work-environment, where you can do anything. In the middel of the core there is a gateway interface which connect the high- and the low-level calls this is the heart of the software all the data and commands going thrue in this interface.

Also important part is the run cycle interface. It is a separate module containing several sub-variant to mach different environments. It is capeable to run OAS files right from commandline or from Autodesk Maya or SideFx Houdini as well. One can easyly writhe a new interface to mach the needs. (for examples if you want to make a tool to connect shaders for Pixar Renderman, you can write a run-parser to translate nodes from OAS to SL language.) This part will be re-organized hardly during the next session of code-consideration it is working a littlebit complicated at the moment.

The whole core able work in a client-server style way. At the moment the current svn release is not containig this feature but we are able to implement it again easyly if there is a right need for it.

The Gui is based on PyQt4, it is in sync with the core features, so you can put down nodes, you can connect them, save or loas OAS files, or you can run the network as well. The next post will explain in detail the functions of the Gui interface.

The OpenNodes collection contains usefull node setups for handling several types of functions and needs from the basic python ones, like loops and if-statements thrue PyQt4 ones and of corse several calls for Houdini and for OpenProject asset-versioning database system. I will explain everything later on in this blog.

Finally here comes some picture to represent some example for the tools and for the networks made with OAS.

Screenshot-OpenTools_Shot-Info

picture 1:This one shows an interface for tracking a Shot for a movie. You can see the comments arrived, or the timing or even the basic structure of the shot.

Screenshot-OpenTools_StoryEditor

picture 2:This is the so-called: OpenStory Editor, written for my home short animation project like the one before.  You can adjust the storyline, make some basic cut, and also you can organize your sequences and your shots. It is fully integrated with the OpenProject system.

Installer

picture 3:This is an asset-based software installer integrated to the OpenProject system, designed to work over the internet to be able to sincronyze the OAS tool with peoples working on the short.

Of course all the examples was made in OpenAssembler!! They are not programmed on the usual way!!!

Where we are now?

•September 20, 2009 • Leave a Comment

First of all, it is important to know that this is the 3rd main release of OpenAssembler.

V1 (2005-2006) was a TkInter based tool. contained the following features:oas_small

  • You was able to create nodes, and the nodedescription files was stored in an xml
  • You was able to put that nodes down, and connect them
  • You could save the network in and oas file
  • It has a nice preferences editor with color picker and everything you imagine…
  • It has a node-network exporter for Olivier Soares’s Swiss Army (there was no running mechanism implemented)

V2 (2007) was still a TK based stuff, but the core was re-developed from scratch.oas_gui_10

  • Three was no need for xml anymore (it recognized a py file as a node with a specific header, like it does now)
  • It had several modules like a console module and it was fully client-server based. (a server was started first and then all the gui elements and the even the console was connected with the server across a gateway module)
  • It had his own running mechanism

V3 (2009) the current release:Screenshot-OpenAssembler

  • From now it is based on Qt4 (much nicer, faster, cleaner code)
  • It was re-writen from scratch again (even much cleaner code) but it still contains a lot of tmp codes (well, I am not a real programmer so I have to re-code it a few times, while the code gets clean and effective and not so amateur)
  • You can embed it to SideFx Houdini (it is a bit tricky and ugly but it is working)
  • We have a wide and well organized node collection
  • There is no client-server mode at the moment, so it is 50%smaller and 200% faster, but it is still working with the gateway system, so I can switch back the server mode if it is needed (but the console mode is still there of course)
  • It can drive PyQt4 windowing features, so you can make graphical applications with it.
  • The following node collections are available at the moment:
  • Math (just basic math, 1-2 node)
  • PyModules (several modules to cover the basic python features, like loops, if ‘ s, data-type handlers)
  • QtModules (several modules for working with Qt4 ui-files like the ones for the buttons, and lists and so on..)
  • OpenProject (a collection of nodes for version controlling (I have my ovn version controlling system which was generally designed for vfx-productions assetmanagements needs))
  • OpenSoftware (nodes for the sourcecode management, it is based on the version controll system)
  • OpenSubmit (submission tools for the assetmanager)
  • CustomQtWidgets (built-in support for Qt4 widget-ing thing.. )
  • OpenModules (a fewtool to build up a project-sequence-shot based database)
  • OpenEdit (for handling edl’s and edit and frame-dependent things)
  • OpenCoordination (for timing and projectcoordination)
  • Houdini (a complete set of tools checking assets in and out, building scenes, rendering, caching…)
  • DrQueue (renderfarm management tools for drqueue)
  • Several AssetManagement and other Misc items to assist the flexible pipeline-development

What is this at all?

•September 20, 2009 • Leave a Comment

oas_example01Hello Everybody!!

On this blog I will present you and talk about my long term development project, OpenAssembler.

What is OpenAssembler? OpenAssembler is a free and opensource project writen in python for python. With few words: it is a node-based python development environment. You can write specialized nodes, or you can use the ones I prepared for you than you can place them and connect them and from the network you made you can generate a python script or, most importantly you can run them on the fly.

A basic example: You want to make a software where you can write in the dialogs two number and by pressing a button you want to see the summ of them in a third dialog? Well it is easy: you can design your window in a Qt4 Designer, then save the ui file somewhere, than you can load the ui file into OpenAssembler, you can place down some Qt-nodes and a summer node, connect it with the given order, and you are done. By pressing the run, you will see your Qt window and it is working… (The attached image showing you a network which can do the trick..)

Of course you can do more than just a calculator app. Me actually working on an AssetManager and version-controllyng system for a vfx-post-production house and of course it is completly made in OpenAssembler. Some friend of mine doing a completly different app based on OpenAssembler (some electricity-enginering stuff and somebody doing a data-organizer)…

In the next post I will explain you the most important features, and a basic structure of the system as well I will present some example from our AssetManager system to demonstrate how complex applications can be done by OAS.

Have a nice day for everybody!