Back to Python
In : Geen categorie, Posted by admin on sep.09, 2011
Well, it’s back to python for a while
We, at House of Secrets, are developing a brand new pipeline framework, all with python and Qt.
It’s pretty exciting for me because I can work with a team and version control for the first time… ever
, but it’s also a fundamental experience as I set up the pipeline, design the classes and the whole architecture. Setting up tools and working methods, do unit testing and documentation generation. It’s a big challenge but I love working on it.
I can’t wait till our first project gets added and used during production!
Meaning we need lots of unit testing and documentation!
Wish me luck guys!
Plug in releases
In : Geen categorie, Posted by admin on sep.09, 2011
Hey guys,
As some of you may notice on Creative crash I started releasing some of my plugins. I got a bunch or id’s from autodesk reserved with my name
this makes it more convenient to release without having to worry about clashing with other plugins.
My first released plugin is my Mesh Blur deformer. This plugin smears the mesh over the animation just like a motion blur.
Check it out if you haven’t done so already!
[ http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/mesh-blur-plugin ]
For the compilers among us, if you compiled a version of it (source code included), please share it
I don’t have to facility to compile older versions and other systems.
My next release will be the feather system. It still needs a lot of tweaks here and there but it will definitly end up at Creative Crash as well!
TrackIR works!
In : Geen categorie, Posted by admin on sep.09, 2011
Yay! it actually works! Let me share the experience with you guys
TrackIR for Maya
In : Geen categorie, Posted by admin on sep.09, 2011
Hey guys,
It has been 3 weeks since I started at House of Secrets, at this point we are looking into integrating the TrackIR camera tracking into Maya, we seen a bunch of bugs and it’s hard to use their SDK without proper documentation.. a couple of txt files isn’t enough in my opinion. However apart from the lack of documentation, I tried a few times integrating it as a MEL Command, this was a big fail. The commands worked and could connect with the camera. However after closing everything like the manual tells me, when I unload the plugin, maya crashes for unknown reasons. My guess is that there is a hidden connection between maya and the plugin that I can’t properly release.
After this struggle I came across a youtube video that does exactly what we wanted it to. So I contacted Joachim Klahr. He was very kind and sent us his code. The SDK was outdated but the integration was something worth trying. However, it gave the same crashing bug I had the other time.
So I started thinking about making a small standalone app that controls the TrackIR camera and connects to maya through the commandport. It uses the Qt SDK for the interface. So far I have a preview window of the camera and an exposure control. (which I will post when I get back to work), my next step will be to get some transformation data, ready for output.
This new approach of combining TrackIR with Maya gives a couple of advantages as well. For instance, being a standalone application it is easy to port to other 3d apps. Re-use the code for other applications with same output.
The current design pattern makes it easy to write such modules to port the camera data to different applications. You would simply have to extend a class from a default class that establishes a connection with the app and sends the data to the app. (The connection with maya would go through its commandport)
Well, that’s all for now
Cya!
Funny enum attribute bug
In : Geen categorie, Posted by admin on aug.08, 2011
The past few days I’ve been crushing bugs for the displace deformer, I came across a really weird one that I still can’t explain. (Aside from it being a stupid move aswell)
The plugin has a couple of attributes to control the shape etc, useUV, useNormal, direction (angle / radial), space (world/local) etc.
However, the space attribute is set as an Enum attribute and it suppost to return a value of his selected index. So obviously I tried returning it as an integer. datahandle.asInt(). this worked a long time, or I just didn’t notice it till the last moment.. It’s return value wasn’t always 0 or 1. When useNormal was true (boolean) then suddenly the returned value from the enum attribute was over 16 milion! So a lot of things weren’t happening when it supposed to. I kept looking in my code and couldn’t find an obvious error at all. So one time I got a big headache from this one and started outputting all the variables and tests etc. Then suddenly I noticed the 16 mil..
Most importantly, how did I fix it?
Instead of datahandle.asInt() I used datahandle.asShort().. this strangely fixed the bug. Like I said, aside of being a wrong move to get an Integer instead of Short, it shouldn’t really matter right? Especially because the attributes didn’t have any connection between them aside from being in the same class..
So, big lesson here: Return Enum attributes as a short, instead of integer (or long!
)
2d / 3d Texture sample in Maya API
In : Geen categorie, Posted by admin on aug.08, 2011
Well, my first week at House of Secrets was great! There are some really bright people there and I’m learning new stuff every day.
My first assignment was to develop a displace deformer like the DisplaceD plugin by hajime (as he is called on Creative Crash) , and the main reason why I had to recreate this plugin was so we are not depending on some third party to take time to compile his code for a new release of Maya. At this point I managed to get all the functionality in my version of the plugin that DisplaceD currently has, it also has the same performance so it should be ready for production in Maya 2012.
What I would like to talk about is some things that I had to find in the API that were not really documented that clear. It was documented, however it left a bunch of questions unanswered.
So the most important function in this plugin is the "sampleShadingNetwork". This function takes a lot of arguments and wether you need it or not, they should be filled.
To my understanding you can fill a bunch of NULLs for things you dont need. But the question was, when do I need a certain argument for my situation? Since all I needed to do first was to sample a simple 2D texture I figured I could scrape alot of arguments. But there were a few that I couldn’t.
So this is the basic sampleShadingNetwork method from the MRenderUtil class:
MStatus sampleShadingNetwork ( MString shadingNodeName,
int numSamples,
bool useShadowMaps,
bool reuseMaps,
MFloatMatrix & cameraMatrix,
MFloatPointArray * points,
MFloatArray * uCoords,
MFloatArray * vCoords,
MFloatVectorArray * normals,
MFloatPointArray * refPoints,
MFloatVectorArray * tangentUs,
MFloatVectorArray * tangentVs,
MFloatArray * filterSizes,
MFloatVectorArray & resultColors,
MFloatVectorArray & resultTransparencies
) [static]
That my friend, is a big list
.
First question was, when I need to sample a texture… what ‘shadingNodeName’ should I get? Well after a few google searches it was clear to me that it doesnt really have to be a node. It can be a simple attribute from a texture input. Like "file1.outColor", so that made it alot easier.
Second, the number of samples. Do they mean they need more samples per point to get an accurate color result? So I figured to put in 1 for performance sake. Turns out, numSamples was the amount of UV or Points that are given to be sampled. So if you have 300 mesh vertices to be sampled, enter 300 (or array.length() to keep things dynamic)
then I did not need any shadowmap information so I entered false for useShadowMaps and reuseMaps.
Thirdly, cameraMatrix. Since I just had to sample a 2D texture, I figured I didnt need a cameraMatrix right? So I filled in NULL. This gave me a compile error that it couldn’t convert the 5th argument from int to MFloatMatrix or something. So I made a dummy matrix and used that instead. (Still don’t know why I need that matrix..)
The points to be sampled, don’t need it for 2D, you can simply use the UV coordinates.
U and V coordinates, finally
something I actually needed. To get these coordinates I tried a few methods. First I tried to get them through the MFnMesh class with mesh.getUVs(). Turns out, that doesn’t give you the right type of UV’s, my question was why? Well… because UV’s can share the same vertex, so the index is not the same as the vertices. So we had to get the UVs in a different way. I ended up Iterating through the vertices and use mesh.getUV(vertIndex, resultUV) and stored them in a MFloatArray. Then we ended up with the correct UV per vertex to sample. (oh and dont use mesh.getUVAtPoint(), it’s terrible slow because it searches for the closest uv coord at a space point)
Then an other bunch of NULLs except for the resultColors and resultTransparencies! And that’s it for sampling a 2D texture.
Next was to sample a 3D texture. That was much easier.. just insert the refPoints and points argument with the mesh.getPoints() result. NULL the u and vcoords.
But this time give a proper cameraMatrix. Like this:
MDagPath cameraPath;
M3dView::active3dView().getCamera( cameraPath );
MMatrix mat = cameraPath.inclusiveMatrix();
MFloatMatrix cameraMat( mat.matrix );
// source from maya API example
That’s all what’s needed for a 3d texture.
So I hope I spared a few guys with the same questions I ran into.
For those who are wondering, I am not sharing my code since it’s property of House of Secrets. I’m just an intern so I have no rights
.
Back to work!
In : Geen categorie, Posted by admin on aug.08, 2011
Holidays are almost over. Internship is coming really close
. I’m lucky enough to get an internship at House of Secrets, a dutch vfx studio in Hilversum.
My job will be to develop some in-house plugins and collaborate with different project on the technical stuff like rigging, rendering, modelling etc.
Guess it involves some artistic stuff too. My hopes would be that I can develop some cool stuff for Maya and work on the studio pipeline with my programming knowledge. As some of you know I recently worked on Rooted, a short film I made with some classmates. During this short film I developed a few plugins for Maya. A Feather plugin that allowed me to quickly make feathered creatures
. Now, when I look back I know there is a lot I could improve, the basic structure of the plugin can be made much faster, algorithms can be made faster. But overall the architecture of the plugins can be made more flexible so it won’t be a problem to add more features. Like, at the moment you can only make area’s of feathers on a Nurbs Surface. It would be much better to be able to choose from single point, individual rows or areas on a surface. And perhaps make it easier to create a surface from mesh object. I encountered a few problems when a surface gets wrapped on a mesh object and the scale goes below .1 and over 2. It would be more accurate if we could just avoid nurbs surface and wrap deformers, and just select faces on the mesh and generate some sort of universal surface data that can be used for the feathers right?
Anyways, those were some things I am thinking about doing in my spare time. As for House of Secrets, I won’t post any details on that. Just if I learn something new, I might share it with a cool example on the blog
Jeroen
Happy New Year
In : Geen categorie, Posted by admin on jan.01, 2011
Happy New Year everybody!
This year has a lot of exciting new stuff coming up.
A new python application! It is a personal project I am really proud of. It is in active development en I will keep it up and publish it open source!
Internship! The exciting year in which the internship gets closer and closer.
And probably way more than I can think of at the moment.
Have a great year!
ANOMALIA: Masterclass Python Programming in Maya Day 6-10
In : Geen categorie, Posted by admin on sep.09, 2010
Hey people,
Back in Holland again
.. The past few days were so cool. We wrote Mental Ray Shaders, Plugins for maya and we got some Matrix and Vector math to keep us focused.
The only way I could describe such weeks is.. “Awesome!”
We learned a lot every day, but never stressed out. The environment was so relaxing, we did games and the food was good. Yet we learned so much!
Now I’m back in Holland so I want to keep my skill sharp! I will try to finish the projects we started
Make them better! And I will show them to you ^_^
Jeroen
ANOMALIA: Masterclass Python Programming in Maya Day 3-6
In : Geen categorie, Posted by admin on sep.09, 2010
Hey Everybody!
The last couple of days were great! (Time of my life.. honestly)
So What have we been up to? We covered Python Classes, JSON, XML, Pickle and best of all: PyQt4 inside of maya.
It took me and Aaron about 3 to 4 hours to figure out how to install is to get it working in maya. We initially installed any pyqt version we found on the net. but obviously, maya used a lower version. But it took us too long to find out. We sat on Czech pc’s so ya… Simple stuff took us hours to find. (we had a few translaters though, thanks guys!)
So our big dance project is turning out great. Everybody is working on his UI to control the dancefloor with mice. making them do a “happy happy joy joy” dance
Now its weekend and time to extend our toolset with extra options for controlling the mice, customizing it afterwards, giving a time offset to make them feel unique :-p.
So yea, that’s basicly it. Time is flying real fast. Its saturday already!!
I dont want to go home yet, we made great friends and an enemy (right Lukas? >: D)… kidding! just great friends
Everybody I met is really interesting and a good friend. I would hate to leave em so soon..
Jeroen
