Wednesday, May 11, 2011

Android and aliens, cohesive forces out to take over the world

(12:25:56 PM) Gyanendra: let's see how it goes:-(
(12:26:12 PM) Nihal Kenkre: tu hai to kya tension hai re
(12:26:22 PM) Gyanendra: It's not ashore has.
(12:26:38 PM) Nihal Kenkre: ashore ?
(12:26:47 PM) Gyanendra: problems drains me out.
(12:27:36 PM) Gyanendra: that's spelling mistake from my phone.
(12:27:40 PM) Nihal Kenkre: :P
(12:27:45 PM) Nihal Kenkre: android huh
(12:27:53 PM) Nihal Kenkre: :D
(12:28:22 PM) Gyanendra: my phone sometime does its own things.
(12:28:36 PM) Nihal Kenkre: ooo
(12:28:40 PM) Gyanendra: Whatever!
(12:28:45 PM) Nihal Kenkre: its tracking your every move
(12:28:54 PM) Nihal Kenkre: and reporting back to its droid overlords!
(12:29:19 PM) Gyanendra: Means?
(12:29:55 PM) Nihal Kenkre: maybe your in possession of some alien life form. a tinee tiny decepticon
(12:31:07 PM) Gyanendra: Hey
(12:31:11 PM) Nihal Kenkre: ya
(12:31:14 PM) Nihal Kenkre: whats happenign
(12:31:15 PM) Nihal Kenkre: :D
(12:31:24 PM) Gyanendra: What is going on?
(12:31:34 PM) Nihal Kenkre: ur phone has built in AI
(12:31:48 PM) Gyanendra: Ya
(12:31:54 PM) Nihal Kenkre: and its learning progressively, the more you use it the more it learns
(12:32:01 PM) Nihal Kenkre: and is adapting to the human way of life
(12:32:25 PM) Nihal Kenkre: using your internet connections its communicating with its droid overlords!
(12:32:36 PM) Nihal Kenkre: hidden some where in the galaxy
(12:32:53 PM) Gyanendra: Where are you?
(12:33:24 PM) Gyanendra: @ home or office?
(12:33:30 PM) Nihal Kenkre: i am on a seek and destroy mission of all terrestrial bots
(12:33:33 PM) Nihal Kenkre: office
(12:34:49 PM) Gyanendra: Are those people troubling you?
(12:35:01 PM) Nihal Kenkre: they are benine now ..
(12:35:17 PM) Nihal Kenkre: but as they learn more and more, they will become a pain
(12:35:26 PM) Nihal Kenkre: they will start living their own lives
(12:35:27 PM) Gyanendra: Looks like you are in a fried mood.
(12:35:35 PM) Nihal Kenkre: irrespective of the owner
(12:35:39 PM) Nihal Kenkre: e.g.
(12:35:51 PM) Nihal Kenkre: your phone calling up some one just to have a talk to them
(12:36:03 PM) Nihal Kenkre: opening a facebook account and getting social
(12:36:07 PM) Nihal Kenkre: completely unnnoticed
(12:36:28 PM) Nihal Kenkre: and when their numbers grow
(12:36:30 PM) Nihal Kenkre: we're dead
(12:36:47 PM) Nihal Kenkre: this is a serious problem and has to stopped at the root
(12:36:55 PM) Nihal Kenkre: SWITCH TO iPHONE 4
(12:37:01 PM) Nihal Kenkre: hahahahhahahaha
(12:37:12 PM) Gyanendra: ya
(12:37:42 PM) Gyanendra: I will, if you gift me one. :-)
(12:38:13 PM) Nihal Kenkre: sadly, my funding is for a seek and destroy mission, not for seek and provide mission :(
(12:38:23 PM) Nihal Kenkre: ur phone needs to be destroyed ...
(12:38:34 PM) Nihal Kenkre: i dont know, this might your phonr talking to me on its own
(12:38:40 PM) Nihal Kenkre: without you noticing it
(12:39:22 PM) Gyanendra: Am very much here.
(12:39:30 PM) Nihal Kenkre: dont be surprised if in some days you find a number of android phones lying around your desk
(12:39:32 PM) Nihal Kenkre: your home
(12:39:51 PM) Nihal Kenkre: slowly u might start seeing them everywhere you look
(12:40:13 PM) Nihal Kenkre: then you will know, that ur phone was the first alternate life form on earth
(12:41:19 PM) Gyanendra: what are you reading these days?
(12:42:22 PM) Gyanendra: Looks like you are traveled beyond this universe.
(12:42:33 PM) Nihal Kenkre: no...
(12:42:36 PM) Nihal Kenkre: im very much here
(12:42:47 PM) Nihal Kenkre: but fact is that , if this continues, we might not here anymore!
(12:43:08 PM) Gyanendra: wherw, which time zone?
(12:43:27 PM) Nihal Kenkre: IST ( + 5.30 GMT )
(12:43:28 PM) Nihal Kenkre: :(
(12:43:49 PM) Nihal Kenkre: fine, call me crazy, but some day you will realize, but then it would be too late
(12:43:50 PM) Gyanendra: Are you sure.
(12:44:12 PM) Nihal Kenkre: all i can say is SWTICH TO iPHONE
(12:45:17 PM) Nihal Kenkre: also 2012 is next year!
(12:45:34 PM) Nihal Kenkre: enough time for one final upgrade to android and we're doomed!
(12:45:43 PM) Gyanendra: Are you using iphone.
(12:46:32 PM) Nihal Kenkre: yes, its the only way out!

Thursday, March 17, 2011

Github repositories up and running

https://github.com/amadlover/


This has repositories for the nkPass project and the imageloaders which has the DPX loader for Maya.

happy gitting.

Monday, February 21, 2011

DPX loader for Maya

This is a plugin which reads DPX files into maya like any other supported format.
It derives off MPxImageFile class to relieve from the pain of converting DPX to some maya readable format before you get working.

Source code to be available soon.

Wednesday, December 1, 2010

Arrow code

As the name suggests code that look like an arrow fall under the catagory of the Arrow Code.

These are caused when data structures contain data structure, and there is a need to run concentric loops, on them.

e.g.

for( int i = 0; i < some_integer; i++ ) {
    if( i == PRESET ) {
        for( int j = 0; j < some_integer; j++ ) {
            if( j == PRESET ) {
                for( int k = 0; k < some_integer; k++ ) {
                    //and so on.
                }
            }
        }
    }
}

The dazzling effects of the code are for everyone to "see".

I had come across this very pattern in my code. The root cause was that i was passing by value, and creating unwanted duplicates.

I changed everything to pointers and there was just 1 for loop and a condition check. Which was pretty cool.

So the next time you see the "arrow code", be pretty sure there is some unwanted checks going on.

Sunday, November 14, 2010

Deforming vertices along normals

This is a deformer that takes a bunch of vertices and deforms them along their averaged normal.

We create a "amount" attribute to tell the deformer how much to deform.

The deformer node is initialized like any other DG node by overriding the required functions.

However, the deform function needs to be overridden instead of the compute function. Maya calls the deform function.

In rare cases, the compute function needs to be overridden instead of the compute. In such cases, the deformation code should be put into the compute function, as Maya would only call compute, and deform function is ignored.

The input "multi" attribute is used to query the input mesh to the deformer. We need the input mesh to get the normal direction on each of the vertices.

e.g.
MStatus myNode::deform( MDataBlock &data, MItGeometry &iter, const MMatrix &mat, unsigned int multiIndex ) {
MArrayDataHandle inputArray = data.inputArrayValue( input ); // get the handle to mesh data.
inputArray.jumpToElement( multiIndex );

MFnMesh meshFn( inputArray.inputValue().child( inputGeom ).data(); // to get the data() as MFnMeshData and MFnMesh is used to manipulate data.

// the MItGeometry iterator is used to iterate through the points affected by the deformer and MFnMesh is used to retrieve the normal information.

#pragma omp parallel for // open MP parallelism.

for( iter.reset(); !iter.isDone(); iter.next() ) {
float weight = weightValue( data, multiIndex, iter.index() ); // convenience function to get the deformer weight at the point.
MPoint pt = iter.position();
MVector normalAtPoint;
meshFn.getVertexNormal( iter.index(), true, normalAtPoint );

//Now the point can be deformed along the normal components via

pt += normalAtPoint * displaceAmount; // displace amount can be calc'ed by varying attributes of the node. e.g. envelope, amount( user defined ), and weight.
iter.setPosition( pt );
}

This can be used in a variety of scenarios. Leave behind any comments or requests or suggestions.

Tuesday, August 31, 2010

Wooly

A standalone hair system, which has tools for creating, combing cutting hair.

Firstly the maya scene is exported out to a custom cache scene format, which read by the hair application.

There are controls for density, sizing, segments of the hair follicles.

The one thing which is really cool / hot is the interactive shader previewer. This allows the user to see their shading results on the viewport itself, without having to wait to go through the rendering process.

Also it calculates self shadowing, based on a fast approximation of the Deep Shadow techniques.

Current state of the output can be seen in the images attached, one with no self shadowing and the other one with self shadows calculated.

Current development: physics / dynamic tools using bullet and the hair editing tools.

Later, would be exporting the viewport shaders to the most popular production rendering engines.

Thursday, August 26, 2010

nkPasses

hello guys i have just put together a shader tool that writes out RGB / matte / masking passes to a single openexr file for maya 2008.

It segregates the meshes / nurbs into layers of 3. So each layer has a mesh with pure R, pure G and pure B, and their combined alpha.

The cool feature is, it has no software limitations on the number of passes. The number of passes depend on the number of objects in the scene. The only limitation is the amount of memory available on the system hardware.

A typical HD 720p scene could render out ~200 passes / layers into an exr. More testing required to confirm benchmarks and in the meantime, I will find a place to upload the files for people to use.

if you are interested in the early bird edition, please drop me your email, will mail it to you.