Thursday, November 06, 2008

Rotate text in Web Generated Excel File

There are many reasons to generate Excel files from your website, mainly generating data reports.
As far as I know there are a couple of ways to generate Excel file from your web server regardless the platform:

- Component Server Side: There are several server-side components available to create excel files. Moreover, if you have MS Excel installed in your computer you can create excel files without third-party components.

-Client Side: If there's Excel installed in the client machine, a client vbscript can generate the file you need. I am not sure if it works under Firefox and, running client-side scripts can create a security hole in your system.

- XML Server Side. One nice feature of excel is that you can generate an excel file without the need of a component. That is, you generate an HTML-like document with the appropriate header and it will be available in Excel.

Well, this is just an introduction, not the subject of this post. I will focus on XML server side Excel file, but you will find several tutorials out there.

A friend of mine asked me how to rotate a text in a generated Excel file using the technique above. She was using the following style properties to accomplish that in HTML:

writing-mode: tb-rl; filter: flipv fliph;

Unfortunately it doesn't work in the excel file. Although Excel accepts HTML styles (CSS) to decorate the cells itself, the code above won't make your code appear vertical.


The following property will do the job if you want to rotate your text:

<td style="mso-rotate:90;">I Rotate</td>

As you can see, the property "mso-rotate:xx", specific to Microsoft products (mso) will rotate the text inside the cell (TD)

It wont only allow you to rotate the text vertical, but using any angle. Some people will prefer smaller angles instead of 90 as they are more readable.

If you want your Excel file look even better you should use "mso-" prefixed styles, they work like a charm.

Saturday, October 18, 2008

Queues with STL

In this project, I was requested to build an application to manage Queues (something like the ones you find when you want to view the latest Blockbuster movie). OK, It sounds simple, use a STL queue.

Unfortunately, this is not the whole requirement. Being a graphical application, it requested to refresh the screen from time to time showing all the items in the queue.

After some research I was not able to find a way to access elements inside the queue, only the Front and Back elements were accessible [if this is possible, let me know]. So, I had to take a look at other containers in STL in order to be able to get the functionality with good performance.

I have selected 4 containers to accomplish this task : Queue (Only to measure it's performance), Lists, Vectors and Deques.

All of them included members to work like Queues:
- Queue: push(int), front(), pop()
- List: push_back(int), front() and pop_front()
- Vector: push_back(int), front() and erase(vector::begin())
- Deque: push_back(int), front() and pop_front()

I performed 2 tests as follows:

1. Pop and Push elements

This test consisted of adding 50'000,000 integer elements to the end of the container, performing a sum of all elements starting from the first one and removing the First element (As a queue works).

Compiling the application to allow profiling with gprof, I get the following results (Please note I resumed them):

i %Time self Child name

[1] 98.2 0.00 16.76 main [1]
0.81 5.27 1/1 testList() [2]
0.78 5.04 1/1 testVector() [3]
0.88 1.75 1/1 testQueue() [6]
0.73 1.50 1/1 testDeque() [7]
[2] 35.6 0.81 5.27 1 testList() [2]
[3] 34.1 0.78 5.04 1 testVector() [3]
[6] 15.4 0.88 1.75 1 testQueue() [6]
[7] 13.1 0.73 1.50 1 testDeque() [7]

As we can see from this results, the best performance was accomplished surprisingly by the Deque (honestly, I thought queues were better) followed by Queues and finally Lists and Vectors, which doubles the execution percent time of the other two.

Why causes Lists and Vectors be that slow? Deeper analysis of the profile results shown that for Lists, most overhead is caused by adding elements to the end of the list (15.5%) and removing elements (12.6%). Getting the first element was really quick, only 2.7% of the whole execution time. Checking Vectors, overhead is caused by the function erase(), about (24.3%) of the total execution time. It looks like vectors don't like to remove their elements. Accessing first element and adding was quick also (3.3%) and (2.8%) respectively.

There's no much to say about Queues and Deques; their performance was similar, but deques outperform queues when removing elements (1.2%) vs (2.0%)

2. Go through the elements

For this test, I will get rid of the insertion/removal of elements in the container as this will happen about 3-4 seconds. I will focus on iteration through the container to display all queue elements. 100 Elements will be added to the queue and system will iterate 500.000 times the whole list.
Performing the application profiling the following results are obtained:

i %Time self Child name

[1] 98.2 0.00 8.28 main [1]
0.71 2.38 1/1 testVectorIterate() [2]
0.51 2.57 1/1 testDequeIterate() [3]
0.66 1.39 1/1 testListIterate() [4]
0.00 0.06 1/1 populate() [33]
[2] 36.7 0.71 2.38 1 testVectorIterate() [2]
[3] 36.5 0.51 2.57 1 testDequeIterate() [3]
[4] 24.4 0.66 1.39 1 testListIterate() [4]

From above results we can see that Iterating linearly the contained was performed faster by the List (24.4%) of the total execution time, followed by Deque (36.5%) and Vector(36.5%).

As you can see in previous example, although we were supposed to implement a Queue, the best option was not the Queue but the List, because, subtle in the requirements, the behavior we wanted was like a list and the bottelneck was not to pop or push elements but to go through them.

From this analysis I can conclude that we can't guide only by the obvious (There's needed something like a Queue, ok, let's use a Queue). Critical areas of an application must be profiled carefully and memory checking tools must be used to ensured that not only the application runs faster but also manage properly resources.

Thursday, October 02, 2008

code::blocks - OpenGL - SDL

After my previous post I decided to play with SDL and try to setup code::blocks with both OpenGL and SDL.
I found it pretty simple (with code::blocks, so many things are easy, forget about gdb). Open your SDL project created previously, and set the link libraries as follow:
(In case you are lost: project->Build Options->Linker Settings

That's all, then you have to include the OpenGL headers or SDL headers:

If you want to include only OpenGL files, you can do the following:
#include <GL/gl.h>
#include <GL/glu.h>

SDL also includes a wrapper for OpenGL in the following file
#include <SDL_opengl.h>

Both should work with code generated by the Template. I have to stop here. If you need more information you can find several tutorials about SDL and OpenGL.

Sunday, September 28, 2008

code::blocks and OpenGL

Last time I used OpenGL was in a University project. By that time, I had to connect using telnet (and xterm, I think, but I barely remember) to a SUN sparc station running probably Solaris. I remember it was really exciting being able to view those simple 3D models on the screen and running in real time!

Lately I was reading some DirectX 10 and sudendly I was wondering what happened to OpenGL? Did It die? Is it there any develoment going on? Surprisingly I found that these libraries are alive and well. It's been used in several platforms including the iPhone so ... you can imagine the future of a technology installed in more than 5 million of devices! (Also, this library is used in both PS 3 and wii (add some other million).

After this brief introduction I decided to build a program under linux, c++ and OpenGL. The IDE of choice Code::Blocks. I used this IDE to build an embedded application so I recommend it. It runs really well with no complains.

One cool thing I found is that Code::Blocks already includes templates to create OpenGL applications using GLUT or using OpenGL with direct access to the X windows libraries.

Now, let's go to the practice. Select File->New->Project. This will pop up the following screen:


OpenGL Library with X-windows access:

OpenGL project is straightforward. You only have to follow the wizard. The project will be ready and you will be able to run it immediately:


As you can see, the wizard is clear and people from code::blocks really did a great job! Below, you can see the simple program running. After finishing the wizard, I just hit F9, and Voila!


OpenGL Library using GLUT:

In order yo have GLUT libraries (and of course, the code::blocks template) you will have to install the following packages:

Installing libxxf86vm from synaptics package Manager


freeglut3 being selected in Synaptics Manager

Please note I have installed the freeglut version of GLUT. You can see in the screen above the following message: "This package has been replaced by freeglut3'. Hmm, It looks like there are some restrictions in the GLUT license. (and glut seem to be out of date).

With these packages installed you can run code::blocks and go through the GLUT wizard.

First step is to let code::blocks where is GLUT installed. Usually all installed libraries in Linux are located in /usr.


Follow the wizard to create your project. Finish it and hit F9. Again, you will be able to see this cool screen: solid and wireframe models.


And .. that's all by now.

ps. I also suggest using SDL (Simple DirectMedia Layer). This library controls also Audio and Keyboard. You should install the following libraries in order to have SDL applications working:

Wednesday, September 24, 2008

Web Browser memory comparison

That title may sound more detailed than it is. I just want to compare memory allocation from 3 popular web browsers I have installed on my machine: Internet explorer 6 (a little out of date), Mozilla Firefox 3.02 and Google chrome 0.2.
All of them ran under the same machine (Windows XP professional). In order to be fair, same web pages were loaded, chosen randomly:
www.elespectador.com (A local news paper)
www.facebook.com (facebook? what's that?)

I have to say before comparing those applications that Internet Explorer was the slowest browser followed by Firefox. The fastest one, chrome, but I have to say that I just installed it so there are no historic information, cookies, plugins, etc.
Facebook did not run flawlessly in chrome, if you can verify, try to send a feedback. The "Send Feedback" link does not work in Chrome.
Aestheticaly (although I think is somewhat subjective) Chrome has a best GUI, it's clean and simple. Unfortunatelly, Firefox is the ugliest one (I think this is because its relationship with Linux. I love linux, but it's ugly).

Now let's see what Task Manager has to say:



The two screens above show the number of processes and memory used by the applications:

Chrome: 21,620k
Chrome: 28,588k
Chrome: 16,136k
Chrome: 21,140k
explorer: 31,044k
explorer: 32,664k
firefox: 56,952k

4 processes for Chrome? hm there's something to explain here .... Indeed, Google created a booklet to explain us, the mortals, why this memory eater software does what it does: [chrome]. Do you think they need to explain us that? Maybe I am wrong so I encourage you to post your opinions. Chrome will open a 20mb process for each page you want to visit. Anyway my system didn't seem to complain about that.

I didn't want to add Internet Explorer because this version is not Tab Based but I will keep it just as a comparison.

Firefox looks just better when checking the memory allocated for that process. It's smaller than Internet Explorer and there's a lot difference with Chrome (is it ok if I sum 21mb+28mb+26mb+21? It looks like a lot of memory).

Now, I will close each application:


This is the performance before closing.

After closing Chrome
After closing i.e.
After closing Firefox
Chrome PF Usage: 1.17 - 1.10 = 0.06GB
i.e. PF Usage: 1.10 - 1.06 = 0.04GB
Firefox PF Usage 1.06 - 1.01 = 0.05GB
You can also check the Total Commit Charge (That is, the virual memory used by the processes)

From these numbers I can say that Chrome uses more memory than the other two applications and, therefore it may slow your computer if you don't have enough phyisical memory. Maybe this can be a trade off between program stability and memory consumption. As you will know after reading the booklet, separate processes won't crash the whole browsing experience. Only the tab implicated may fail.

Finally I have to add that both Firefox and Internet Explorer crashes in my system about one time a week (not that bad).

p.s. Visiting Chrome home page I found that the latest version available is BETA although About box in my machine doesn't even mention that: 0.2.147.27, Official Build 1583.

Comments and corrections are welcome.

Tuesday, June 24, 2008

Valve's Source - Part 3


Authoring a Logical Entity


This post is related to the second modding tutorial you can find [here].

This is a very important tutorial as it's a real introduction to Mod programming in Valve's Source, and if you understand it you will be able to do more complex stuff.

Exploring this tutorial is not clear what is it purpose or how can you test it. That's the purpose of this post, make it clearer. Please note, there's not a single example of how can you use the entity or where it can be useful. I will help on that.

Go through the tutorial and, when you have completed the Build process, go back to this post. I will just mention a couple of things may help you with this process.

1. Although there's no mention about that, it's good if you start with the mod you just created in previous tutorial.

2. the sdk_logicalentity file name can be any other, what really matters is the following line:

LINK_ENTITY_TO_CLASS( my_logical_entity, CMyLogicalEntity );

Where you link the class you are creating to "my_logical_entity" label in the FGD file. This name is what you will see in Hammer

Once code is built, you can start the process of adding the logical entity to your map. Create the FGD as suggested in tutorial, and let's proceed with the map.

Now, open the Source SDK and double click the Hammer editor (Where you create the Levels). Before opening Hammer, make sure that under "Current Game", you have to select the Mod you have modified.


Now, you have to setup Hammer so you can use the logical entity by linking the FGD (with the entity description) to Hammer. Follow tutorial Instructions but, take a look at my screenshot. In Configuration, make sure you selected your Mod and, in Game Data Files, click on Add to add your FGD file. That's all. You are now ready to create your Level.


I won't give details on how to create a map, but it's prety straightforward if you have used a 3D package before. You can follow the Your First Map tutorial to create it. I just made a squared room where the action will take place.


As you can see in the screenshot, I added three rpg rounds (item_rpg_round) a crate (item_item_crate) and an npc grenade (npc_grenade_frag). Also, a player (Dr. Freeman) has been added so the game is ready. Now, run map to create the BSP file. I check "Don't run the game after compiling" so you don't have to start the Mod for every change you do. Instead, run your Mod from Steam and load map by typing "map [your map name]". If you make any change in your map, compile it and reload it in your Mod without restarting the application.

Note. Do not forget to name every object in your map (well, at least the most relevant) so you can link them later in events.

Now the logical entity starts to work. Let me think of a counter usage (no clues in tutorial) ... hmm it can be use for example to count flags you capture. Another usage ... as a trap; in our example we will use the counter to setup a trap for a player hungry for Ammo. If the user takes more than two Rpg rounds, the hidden grenade will blow punishing player. Got it?

Add my_logical_entity to the map and, place it anywhere (Mine is the red square on screen). Double click for properties. In threshold keyvalue enter 3. That is, the output is launched when count equals 3.

Go to outputs and add a new Output. Take a look at the following screenshot. Please note that, when the event "OnThreshold" is triggered, The entity "My Grenade" will call it's action "Ignite", that is ... blow!!


Now, there's only one thing left ... How to increment the counter? Take each Rpg Round and add an output: In the event that user touches the Round (OnPlayerTouch), tell the target (First Counter, this is the name of my logical Entity) to "Tick", that is, increment the counter. Do this for every round.

Now, when user picks up all three rounds, the logical entity counter will increment to 3 and the grenade will ignite.

This is how it looks when playing.


That's all. I hope you enjoy creating some other Logical Entities. Let me know what came to your mind.

Monday, June 23, 2008

Shaggy Vs. Cumbia Cienaguera

It's football time, UEFA cup is about to finish, and every time a game starts the official video is shown on TV. It's Shaggy's "Feel the rush". A nice song but ... hold on .... I can hear something familiar ... I've heard that accordion notes somewhere in my childhood ....

Please, check Shaggy's video below when a happy and friendly guy plays the accordion (Thanks Germany for this wonderful instrument), and listen carefully.



Oh I remember where I heard that. I was young ... long time ago ... and that song played everywhere in parties. It a song from the country, It's name "Cumbia Cienaguera" means Cumbia from the pond (cumbia is a music style from the Colombian Folklore), composed by Martinez and MontaƱo.

Follow this link to listen the original version [here] and click on the speaker link next to the song name "Cumbia Cienaguera".

Is Shaggy aware of anything I mention here? I hope so, otherwise, I think there's some kind of Copyright Infringement. Can anybody give some lights?

Thursday, June 19, 2008

Maya 2008 Plugin development - Part 2

Intro

Fortunately, you are not tied only to the development of plugins for Maya 3D using C++, which implies a good knowledge of programming, debugging, memory management, etc.

Using Python has some advantages over C++:

  • Multiplatform: Although C++ can run in multiple platforms, you have to fit the code to the machine and use different compilers and setting for each platform (although you use open source compilers). Anyway you have to recompile. There's no such in Python. It will work in every platform.
  • Faster coding: Coding in Python is a way easier than C++. Few setup steps are required to develop applications in Python, and obviously, results will be seen faster.

Nothing is perfect, so these are the disadvantages I can think of:

  • Speed: Being a scripted language, Python is a lot slower than C++ (Compiled)
  • Low Level Programming: If you need to make son low level operations, then C++ (and assembler calls) is the right option.
For in-house development it's ok, but if I really want to make a commercial product (to be sold as a commercial plugin) I think C++ is the best choice.

(Please correct me if I made any mistake)

Python Plugin

Ok, but the purpose of this post is to have a small guide to setup Maya to be able to create a python plugin ... let's start.

Python packages are located here:


{Base Maya Directory}\Python\lib\site-packages

The only step needed to setup the Maya is by creating an environment variable in the system:


Variable name: PYTHONPATH


Value: {Base Maya Directory}\Python\lib\site-packages






After this variable has been created, you should restart Maya in order to have it updated with the new variable pointing to the Python libraries.


Now, let's test if Python works. Try the following in the Maya Script Editor (Please make sure you are working in the Python Tab as shown in the following image

import maya.cmds as cmd

If you get the following error, then the Python variables were not set up properly. Please check your environment variable making sure that you have not included the "Maya" subfolder in the PYTHONPATH variable.

# Error: No module named maya.cmds

If no error is thrown, then you can start writing your Python scripts. Let's create a sphere with a radius of 3 units. The following command will create the new object named "Sphere1"

cmd.sphere(name='sphere1', radius=3)


Now you have a nice sphere, let's change some shape .... hmm something like an American Football ball (or whatever it's called ... pigskin?). To accomplish this, let's scale the sphere unevenly:


cmd.setAttr('sphere1.scale', 1, 1, 2, type='double3')


Note that the attribute is "scale" from the "sphere1" object. Also, we have a vector of 3 doubles with values 1, 1 and 2.

Finally, let's change our ball color. If you are thinking on something like setAttr sphere1.color, then you are wrong. Remember that color does not belong to the sphere itself but to the shader linked to it. By default, shader is lambert1, so let's change ball's color:

cmd.setAttr('lambert1.color', 0.63, 0.146, 0, type='double3')

Again, we modify "color" attribute from "lambert1" object, by updating color value using a 3-vector of doubles.



I hope this brief introduction will help you in your journey inside Maya scripting.

Thursday, June 05, 2008

Open Source Control Version System (Part 2)

Client Side


Now that we have setup the server side application and repository, clients (developers) should have access to repositories using a client tool.


A useful tool for this purpose is the TortoiseSVN. It's a subversion client for windows. (Please note that subversion is the core of the Version Control Server). It support several protocols including http (the one we will use for VisualSVN Server) and it's really easy to use.

After you have downloaded and installed the application you will be surprised that there's no applications to run (rather than the diff and merge applications) to manage files. Instead, under the windows explorer you will find new options when you right-click on a file or folder (that's what it's called a shell extension).

The first step to setup your environment is by creating a directory where your files will be stored where you take them from the repository. Of course this folder can be the location of the sources after you created a project, or the location of your local web application.

So, choose your target directory and right click, then select "SVN Checkout".




A window will ask you for some information like the location of the SVN server (in this particular case is the SimpleSample folder) and click OK. This action will take a copy of all files from the repository into the folder you selected.


Now, you can open any file inside that folder and start the edition process, and saving in your local machine. Then, when you feel comfortable with its functionality, you can send it back to the repository by selecting SVN Commit and of course, you can get the latest version of the file by clicking SVN Update.

Of course there's more than that, but at least you have your SVN working and you can try other great features like merging, file versions, etc.

Wednesday, June 04, 2008

Valve's Source - Part 2

My First Mod

This guide complements My First Mod basic tutorial from the Valve's developer web page, so please, have booth pages opened.

After you have downloaded and Installed the SDK, you should run the Game and .... just to make sure everything will run ok, restart the computer (Well, I had to do it because the Source SDK didn't start when I tried to run it)

This is how Source SDK looks when you double click on the application. In order to continue with the tutorial, double click on the Create a Mod link under Utilities.



It takes some time to create all Mod files (All source files required to rebuild the application). When finished, a folder src is created and, below it there's the Solution. Please open it according to the Visual Studio version you have. In my particular case, it's VS2005.

Following screen shot illustrates the solution location, as well as the Rocket file location and line to be changed:


You go through the steps in tutorial in order to compile changes. Now you have to restart Steam. By restarting, I mean right click on Steam tray Icon, select Exit, and open the application again. You will then be able to see something like this (FabianMod is now available):



Please follow me. Although tutorial is correct, it's confusing because it says "Run the game", but then ... hold on, there's nothing to view, please go back and do this... These are the instructions I propose:

1. After Building the application, you have to have a map to test the change you just did in the rocket speed. So, download GCFScape. This application will allow you to copy a map from the HL2 library into your Mod.

NOTE: You don't have to copy the map inside the folder where the solution is located. When you build the Mod, a folder is created in the following path (In this particular example):

$ValvePath\Steam\SteamApps\SourceMods\FabianMod

So, copy the map into the maps folder just below FabianMod (or your Mod's name).

2. Start the Mod from the Steam console.

3. Enable the ~ key to be able to open the Console

4. load Map by typing "map [your map name]" and hit enter

5. Enable cheats to be able to select Rocket weapon: "sv_cheats 1"

6. load all weapons by typing: "impulse 101"

That's all, now you should be able to launch a really slow rocket . I can even take a screenshot!

The following is an in-game screenshot:


Tuesday, June 03, 2008

Open Source Control Version System (Part 1)

When Software Projects become larger and more people is involved, there's need to keep control of source code files.
Usually, several users have to make changes at the same time in a core file. Doing this the wrong way may lead to delete changes made by a developer, wasting a lot of time and raising errors in the coding.
Fortunately, there's Version Control software which keeps track of who is using a file, keep versions of that files, allows merging, branching and other cool stuff to keep your software project synchronized.
There are several vendors and open open source versions of this software, and a couple of models. Please check the List of Revision Control Software.

In this case we are going to setup a Control software using a Client-Server model with an open source application.

Server Side

VisualSVN is our choice, because it's Open Source, provides an easy installation package and a clean control panel. Just download it from VisualSVN. After downloading, run the setup and follow the wizard:


Next, set install location and repositories path. Repository is where the files will be physically located (Please do not modify anything inside repositories unless you know exactly what are you doing). Also, set the server port. VisualSVN Server runs on Apache server and it can be accessed through http protocol, that is, you can have some access using a web browser.



That's all. Now you can access the control panel using the Manager:


First of all you have to create the users who will have access to the repository by clicking on the "Create new user" link.


Final step in the server side is create the New Repository, that is, the particular space where the application files will be stored. I created a sample for this:




You can check if your system is running properly by logging to the VisualSVN server location using a web browser (As I am running local, I just entered localhost:8080/svn/SimpleSample):

Just remember you log in using the SVN user you created previously. You can create a user for each developer, so when you track changes you can view who modified the application by the means of this user.

Wednesday, May 28, 2008

I can ride my bike with no handle bars

Handlebards is a cool song I have been listening lately from a band named Flobots.

It's so cool not only the music or the Trumpet sound (for me it sounds like a trumpet) but their lyrics are loaded with a strong message, not the usual blatant lyrics and the video clip enforces the meaning of the song. Please listen and watch it!

Saturday, May 17, 2008

Spherical Helix Plugin

This plugin for Autodesk Maya, will create a Spherical Helix made of a Nurbs curve.

The usage for this plugin is:

SphereHelix -r -h -n

-r: The sphere maximum radius. By default, radius is 1
-h: The curve height from y=0. By default, height is 1
-n: The name of the Nurbs curve. By default curve name is SphereHelix#,
where # is a consecutive number for existing curves.

To install plugin, just download it, unzip it, copy .mll to \bin\plug-ins and load it from the plug-in manager.

Following images were created with this plugin using different settings:



Find out the plugin here:

[Plugin Download]

Thursday, May 01, 2008

Maya 2008 Plugin development - Part 1

Building plugins for Maya allows both Game Developers and Artist to customize Maya and speed up the workflow.

So far, doing some reading and research, I found there are two ways to develop Maya plugins: Using a traditional compiled VC++ .mll plugin or by using Python.

I will start this research by building a simple plugin using Visual Studio 2005 (Visual Studio 8)

1. Start by installing the Plugin Wizard

First step is to setup the Visual Studio environment. Fortunately, Maya includes a Plugin Wizard for Visual Studio 8 (aka Visual Studio 2005) so you can create them easily.
Plugin wizard is found in the following location:

\devkit\PluginWizard

Of course, you can follow the readme instructions, but there's a little change you should do in order to have the plugin working.

a. Unzip the MayaPluginWizard2.0.zip file

a.1 This is the new Step:

Edit the MayaPluginWizard.vsz file, and change the following line:
Wizard=VsWizard.VsWizardEngine.7.1
to
Wizard=VsWizard.VsWizardEngine.8.0
(For Some reason wizard developers forgot to update this for Visual studio 2005 Developers)


b. Copy the following files:

MayaPluginWizard.vsdir MayaPluginWizard.vsz MayaPluginWizard.ico

To \VC\VCProjects

c. Copy the MayaPluginWizard folder to \VC\VCWizards


2. Create plugin in Visual Stuio


(This is a sample check box.)???

Is there something missing to finish in this Wizard?

Create a new project, as usual, and click OK. The wizard will show you the screen above. Then you should choose the options you want. By clicking Next you must select the type of plugin you want to create and the Command Name for this plugin (This is the entry point of the plugin in Maya; that is the command you write when calling the plugin)


That's all, you are ready to write your plugin. Please note the Wizard will setup the project so you only have to build the project and the .mll file will be created.

3. Install Plugin in Maya


Open Maya (of course) and go to Window->Preferences->Plugin Manager, click Browse and find the plugin you just created. It should be marked as "Loaded". Check "Auto Load" if you want the plugin to be loaded everytime you start Maya.

4. Execute the Plugin

Open the Script Editor and excecute the command you just created. This is the result from mine:

MysimpleMelCommand;
// Result: MysimpleMelCommand command was successfully excecuted
//

That's all. I hope it works for you.

Some Sources:
http://highend3d.com/boards/lofiversion/index.php/t220538.html

Friday, April 18, 2008

Valve's Source - Pre

Lately, I've been going through the process of learning about Valve's Source.

Initially, you should own a valid copy of any Valve games (I actually own HL2, so I am ready to work).

First step in this process is to get the Source SDK from the Valve website. It's really easy, as you only have to open the STEAM Control Panel and, under the Tools tab, you have to double click on Source SDK Base and Source SDK packages, and Steam will install and download them for you. As easy as it can be.

The follow link will guide you in detail:

http://developer.valvesoftware.com/wiki/SDK_Installation



Please follow the instructions ... not as I did ... It's mandatory that you run the game before running the SDK, otherwise SDK won't run!



When you are ready, you can launch source from Steam Control Panel. Your entry point then is to visit the SDK Reference Docs located in the Documentation Area.



What's first? Creating a Map? Creating a Mod? Is there any place to start? I am lost!!! Here is where I complain about the documentation from Valve. Well, According to the Oxford English Dictionary (1997), complain: say one is dissatisfied. So, instead of complaining, I will try to give some more details on the tutorials where you can get clueless as there are not details, screenshots, etc.



So, let's start. The following link will take you to the Entry point for basic documentation:


http://developer.valvesoftware.com/wiki/Category:Programming


Next tutorial will guide you through the creation of a Mod.

Saturday, April 12, 2008

Future is written ... in history books

This phrase came to me after a discussion with my wife regarding whether the Future is already written or not. That is, if everything in our lifes has already been established previously, like the destiny.

If you are supposed to be a Musician, there's nothing you can do to change that; a Predestination.

But, I totally disagree with that thought. I think everyting is happening right now! and you can change it now!

Here we use that quote: "Future is already written".

I have decided to rephrase that with the following:

"Future is already written ... in history books"
"el futuro esta escrito ... en los libros de historia"

What do you think?

Monday, March 10, 2008

Traicionera

Traicionera (Betrayer) is a song played by Jose Pastor Lopez, a tropical music singer from Barquisimeto, Venezuela. His work is appreciated here in Colombia where his songs were enjoyed by our parents.
As a Tribute, and after some attemps to create animated precolumbian characters I designed and built the following musical video:





Animation an rendering was developed in Lightwave 3D Version 6.5. Carlos Santa helped me with camera positions and movements. That was really helpful as my knowledge in this field is limited. Adobe premiere did its work on the edition and sound mixing.

Tuesday, February 12, 2008

My First book about computers and Basic

These were the first books I read about computers and programming (out of the books I read in school), where I really understood how everything worked inside of it and lead me to the path of computers.

Thanks Luca Novelli!!!!!



Monday, February 04, 2008

Crysis

Crysis is the most advanced game I've ever played (so far). Graphics are stunning, although I have to say that it requires a powerful machine to run. Even on my machine with good features, the ending still runs slow with the lowest settings.



Gameplay is great and every weapon has customization options. According to the developers, the whole environment is 3D. That is, even the distant mountains are 3d models, not Bitmaps.

Folliage looks great too and trees can be destroyed with the weapons available. One nice features is the ability to hide beneath the bushes. Some people rather prefer direct fighting with enemies, but I love the ambush!

Being invisible is a good option inside the game. You can walk undiscovered by using the Invisible tool but even with that, enemies will suspect there's something around there.

Finally, I have to note that characters are very detailed, you can even see the wrinkles on the face of this man. Check out the above screenshot.


Amazing!!! Isn't it?