Page 1 of 2

Maya to Octane’s scatter node

Posted: Tue Jul 24, 2012 3:27 pm
by tchoa
Hi

As I was told my post seems to be somewhat lost in the thread 'OctaneRender® 1.025 instancing preview test build', I'm opening a this thread.
Here is a little script of mine that can export the .csv file to feed octane's scatter node: Maya to Octane’s scatter node
As I explained it on the page, no GUI at the moment, just a file browserDialog to save the file(s).
It will export all transform's matrices selected and their chids(transforms), and also all instancers (particles) splitting in files if you have 'mapped' instance IDs.
This is for exporting to Octane standalone, JimStar is on his way to get instancing in a next version of the Maya plugin ;)

F

duplicate contents in Instancing link

Posted: Tue Jul 24, 2012 4:48 pm
by p3taoctane
This is a duplicate post. Sorry for that... but I agree that it gets lost in the Instancing link and I am not sure if I can remove it.

Trying to figure out Nodes.
Thanks Tchoa for the fixed script that exports the matrix from Maya.

Am I loading the contents from the excel file correctly? I have different values it seems than the Maya files show.

Here are my steps....

Create simple cube in Maya
Duplicate special option and create multiple instances
Randomly rotate the instances but leave translation values alone

Select all objects and run octaneInstancer (which generates the excell file with a matrix of the instances co-ordinates I assume)

Export JUST the original Mesh cube as OBJ

Run Octane Instancer Beta

Import OBJ Mesh as normal
Create Scatter, placement and geometry node.

OBJ into Placement into scatter (with contents of excel file co-orinates plugged into the matrix node) scatter into geometry into render target

As you can see the result is diff than the maya instances...

I am thinking it is because I am trying to control "placement" by the excell file with a "scatter" node which does not make sense... but how do I copy in the excell values into a placement node. I do not see a place for it?

Thanks for any input

Peter

Re: Maya to Octane’s scatter node

Posted: Tue Jul 24, 2012 6:03 pm
by tchoa
Peter

Let's go for my short answer as far as I well understood your problem...
I followed your steps and all is fine unless I'm tweaking the translation of the placement node, what's make sense.
So if you tweak the placement's translation of the mesh before scattering it, things may be lost in space...
If you tweak rotation and scale that should be useful.
If you tweak a placement node that has the scatter node as input it will transform the whole scattered objects group.
The placement node has no matrix input, as it is simple transformation that has to be easily tweaked.
So, I don't understand why you opened the csv file in excel... as matrices are unreadable unless for some people with autism.
The script just exports matrices file to be read by the octane's scatter node.
(I assume you have y-up axis setup in Maya)
Tell me you want the script more handy, perhaps it can take a only few minutes to modify it...

F

Re: Maya to Octane’s scatter node

Posted: Thu Aug 02, 2012 11:58 am
by tchoa
Small script update.
v0.4 – Transform’s matrices ares now exported in absolute world space (taking the matrices of its parents). Also a simple GUI has been added.

Re: Maya to Octane’s scatter node

Posted: Sun Aug 05, 2012 10:33 am
by Refracty
Excellent work as usual Tchoa.
It works fine with instanced geometry.
Is this meant to work with the maya particle instancer as well?

Re: Maya to Octane’s scatter node

Posted: Sun Aug 05, 2012 7:43 pm
by tchoa
Yes Nando!
Just have one or more instancer node selected (not the particleShape).
If you have the objectIndex mapped or computed through a creation expression, it will generate as many files as instanced objects.
Split will be done like this 'name_instancedObjectName.csv'.
As I coded it in mel and very quickly the speed of the split could be slow for large amount of particles and intanced objects.
Maybe I'll code it as python plugin to have it faster (if some users ask me and when I'll found the time).

Re: Maya to Octane’s scatter node

Posted: Mon Aug 06, 2012 8:36 pm
by Refracty
Ah, that's cool Francois. Thanks fo the info. I will test it soon. Let's hope that the official Maya plugin will integrate instance support soon.

Re: Maya to Octane’s scatter node

Posted: Thu Aug 30, 2012 8:36 pm
by Refracty
I have a little question about bringing particle instances with directions to Octane.
Lets say I have a surface where I spray particles on (by using the Maya particle tool). I want to export the particles including the normal direction information of the underlying surface.
Is there a way to bring the Orientation information to of the particles to Octane?

Re: Maya to Octane’s scatter node

Posted: Fri Aug 31, 2012 12:25 am
by tchoa
Hi Nando

Here is my quick answer to work with the classic particleShape.
Add to your particleShape two per particle attributes of type vector, let's call them e.g aimPP and aimDir.
Create one expression 'Runtime before dynamics' to modify the rotation of your particles (as you just painted your particles on surface with the particleTool) with the following expression:

Code: Select all

vector $vec = myParticleShape.position;
vector $vec = `nearestPointOnMesh -ip ($vec.x) ($vec.y) ($vec.z) -nr -q -na myPolyShape`;
myParticleShape.aimPP = $vec;
myParticleShape.aimDir = <<0,1,0>>;
In the instancer of your particleShape set the rotation options: Aim Direction << aimPP and Aim Axis << aimDir
Step forward on frame and from the Solver menu set initial state for your particles.
If you want to modify the base axis simply change the vector <<0,1,0>> to what you want.
This assumes that you have the nearestPointOnMesh plugin loaded.
You should also be able to use the pointOnMeshInfo plugin that's coming with the bonusTools and its pointOnMesh command (can't remember the flags and 'help pointOnMesh' returns nothing).
I thought about that because I don't remember exactly since when the nearestPointOnMesh plugin is included in maya ;)
There's also the closestPointOnMesh node that could be used... if I well remember it's used when you draw instances with the Paint Scripts Tool setup with geometryPaint to have the instances following the geometry you've painted on.

F

Re: Maya to Octane’s scatter node

Posted: Fri Aug 31, 2012 9:26 am
by Refracty
Francois,
you are brillant as always.
Thank you for your help my friend :)