Monday, December 2, 2013 Tuesday, July 23, 2013

Build environment Windows 7 64-bit and Maya 2013/2014 64-bit

Instruction to create build environment for Maya plugins developement on Windows 7 64-bit and Maya 2013/2014 64-bit

Maya 2013/2014 requires Visual Studio 2010 SP1 64-bit compilers. There’re some steps to get’em with free Visual C++ 2010 Express.

1. Download and install Visual C++ 2010 Express (offline installer)

2. Download and install Microsoft Windows SDK for Windows 7.1 (offline installer) GRMSDKX_EN_DVD.iso for 64-bit systems.

3. Download and install Microsoft Visual Studio 2010 Service Pack 1 (offline installer) installer will remove 64-bit compilers.

4. To fix missing compilers download and install Visual C++ 2010 SP1 Compiler Update for Windows SDK 7.1 (KB2519277) (link). Some details on that.

Instruction to set up Visual Studio project to compile plugins (Wizard from Autodesk doesn’t work with Express edition)

From here.

1. Start a new empty project
2. Add a source file
3. Right-click on the project and choose “properties”
3. Pull up the “configuration manager”
4. From “active solution platform” choose “New”
5. Choose “x64” from the dropdown list
6. Return to the project properties
7. Set the target extension to “.mll”
8. Set the platform toolset to “Windows7.1 SDK”
9. Set the configuration type to “dynamic link library (.dll)”
10. Move to the VC++ Directories panel
11. Append “;c:\program files\autodesk\maya2012\include” to the include directories
12. Append “c:\program files\autodesk\maya2012\lib” to the library directories
13. Navigate to C/C++ and Preprocessor
14. Write “_DEBUG;WIN32;_WINDOWS;_USRDLL;NT_PLUGIN;_HAS_ITERATOR_DEBUGGING=0;
_SECURE_SCL=0;_SECURE_SCL_THROWS=0;_SECURE_SCL_DEPRECATE=0;
_CRT_SECURE_NO_DEPRECATE;TBB_USE_DEBUG=0;__TBB_LIB_NAME=tbb.lib;
REQUIRE_IOSTREAM;AW_NEW_IOSTREAMS;Bits64_;%(PreprocessorDefinitions)” to preprocessor definitions
15. Navigate to Linker and Input
16. Append to additional dependencies the following list: “;Foundation.lib;OpenMaya.lib;OpenMayaUI.lib;OpenMayaAnim.lib;OpenMayaFX.lib;Open­MayaRender.lib;Image.lib”

Although I suppose it would be better if you append Maya’s lib dir to Linker -> General -> Additional Library Directories and Maya’s include dir into C/C++ -> General -> Additional Include Directories.

Sometimes compiled Maya’s plugin doesnt load and outputs into script editor something about initializePlugin function, to fix it, add to Linker -> Command Line -> Additional Options “/export:initializePlugin /export:uninitializePlugin”.

Monday, July 1, 2013

Build environment Ubuntu 13.04 64-bit and Maya 2014 64-bit

Instruction to create build environment for Maya plugins developement
on Ubuntu 13.04 64-bit and Maya 2014 64-bit.

Based on official documentation and ilBozo’s post

Download the gcc 4.1.2 source tar file from http://gcc.gnu.org/install/ for example here

Setup directories:
mkdir ~/gcc-4.1.2
tar -C ~/gcc-4.1.2/ -xzvf /path/to/the/file/gcc-4.1.2.tar.gz
mkdir ~/gcc-4.1.2/gcc-build/

At this stage we should be ready to build but first we need to be sure that we’ve got all the dependencies needed to compile. We need the linux-headers gcc-multilib, zlib1g, zlib1g-dev, zlibc
sudo apt-get install linux-headers-$(uname -r) gcc-multilib zlib1g zlib1g-dev zlibc

First of all you need to edit the file ~/gcc-4.1.2/gcc-4.1.2/gcc/config/i386/t-linux64.

At line 9 you should find:
MULTILIB_OSDIRNAMES = ../lib64 ../lib

You need to modify it as follows:
MULTILIB_OSDIRNAMES = ../lib64 ../lib32

Open the file ~/gcc-4.1.2/gcc-4.1.2/libstdc++-v3/configure and at line 8284 replace:
sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`

with:
sed -e 's/GNU ld (GNU Binutils for Ubuntu) \([0-9.][0-9.]*\).*/\1/'`

Open the file ~/gcc-4.1.2/gcc-4.1.2/gcc/config/i386/linux-unwind.h and at line 139 replace:
struct siginfo *pinfo;

with:
siginfo_t *pinfo;

then at line 141 replace:
struct siginfo info;

with:
siginfo_t info;

Here the diff file for example.

Last thing to do is to link some library otherwise the compiler won’t find it.
cd /usr/lib
sudo ln -s x86_64-linux-gnu/crt1.o crt1.o
sudo ln -s x86_64-linux-gnu/crti.o crti.o
sudo ln -s x86_64-linux-gnu/crtn.o crtn.o

At this point we are ready to compile gcc.
Go in the build folder:
cd ~/gcc-4.1.2/gcc-build

Run the configure as autodesk suggests on 1 line and add option —enable-languages=c,c++.
../gcc-4.1.2/configure --prefix=/opt/gcc-4.1.2 --program-suffix=-4.1.2 --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit --enable-languages=c,c++

and then compile it:
make -j 2 bootstrap MAKEINFO=makeinfo

As soon as the compiling process ends without throwing errors you will be able to run:
sudo make install

Note: you can make a symlink in /usr/bin to make the call to gcc easier for the user:
cd /usr/bin
sudo ln -s /opt/gcc-4.1.2/bin/gcc-4.1.2
sudo ln -s /opt/gcc-4.1.2/bin/g++-4.1.2

No you can follow instructions from official documentation, copy plugins folder /usr/autodesk/maya2014-x64/devkit/plug-ins/

In file /devkit/plug-ins/buildconfig add after line with
gccVersion := 4.1.2

This 2 lines in order to configure compilers
CC := gcc-4.1.2
C++ := g++-4.1.2

That’s it. In /devkit/plug-ins/ folder you’ll find examples and templates with correct makefiles. You can compile any plugin separately just by entering a plugin’s folder and running make.

Thursday, January 10, 2013

Pipeline to get realistic pyroFX in games.

1. That’s how fluids OpenGL viewport rendering looks like.
2. CG-artists could tweak a look of explosions, fire, and so on.
3. There’s a Field3d I/O example in a HDK directory to export fields into a game engine.
4. There are Houdini’s volume shaders in a Houdini installation folder to use in a game engine.

Thursday, December 20, 2012
GDB is brilliant!The Art of Debugging with GDB and DDD
Wednesday, December 19, 2012 Tuesday, December 18, 2012 Monday, December 17, 2012 Friday, December 14, 2012 Wednesday, December 12, 2012 Wednesday, December 5, 2012
CG Underground

CG Underground

Monday, November 12, 2012
Friday, October 12, 2012

Київ столиця України.

А українська культура
нехай шириться поміж українцями
і хай про її поширення
турбуються і піклуються діти України —
усі, хто любить свій нарід
і бажає йому добра,
бо чужі за се не візьмуться.
Нехай усім народам живеться вільно на Україні,
але нехай нові поселенці на Україні пам’ятають,
що не може бути зневажений
на своїй рідній землі (як се було раніше)
той український нарід,
котрий заселив її, захистив од ворогів
і довгі часи поливав своїм трудовим потом.
Д. І. Багалій, 1917 р.