Maya to Octane’s scatter node

Autodesk Maya (Plugin developed by JimStar)

Moderator: JimStar

tchoa
Licensed Customer
Posts: 189
Joined: Thu Jul 01, 2010 12:33 pm
Location: Montpellier

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
Win XP x64 | Q6600 2.40GHz | 8Go | GTX470 1.28Go // Win 7 x64 | I7 Q740 1.73Ghz | 6Go | GTX460m 1.5Go
p3taoctane
Licensed Customer
Posts: 1418
Joined: Mon Jan 25, 2010 12:53 am

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
Attachments
Scatter_Screen_Dump_JPG.jpg
Windows 7 Pro_SP 1_64 bit_48 GB Ram_Intel Xeon X5660 2.80 GHZ x2_6 580GTX_1 Quadra 4800
tchoa
Licensed Customer
Posts: 189
Joined: Thu Jul 01, 2010 12:33 pm
Location: Montpellier

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
Win XP x64 | Q6600 2.40GHz | 8Go | GTX470 1.28Go // Win 7 x64 | I7 Q740 1.73Ghz | 6Go | GTX460m 1.5Go
tchoa
Licensed Customer
Posts: 189
Joined: Thu Jul 01, 2010 12:33 pm
Location: Montpellier

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.
Win XP x64 | Q6600 2.40GHz | 8Go | GTX470 1.28Go // Win 7 x64 | I7 Q740 1.73Ghz | 6Go | GTX460m 1.5Go
User avatar
Refracty
Licensed Customer
Posts: 1599
Joined: Wed Dec 01, 2010 6:42 pm
Location: 3D-Visualisierung Köln
Contact:

Excellent work as usual Tchoa.
It works fine with instanced geometry.
Is this meant to work with the maya particle instancer as well?
tchoa
Licensed Customer
Posts: 189
Joined: Thu Jul 01, 2010 12:33 pm
Location: Montpellier

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).
Win XP x64 | Q6600 2.40GHz | 8Go | GTX470 1.28Go // Win 7 x64 | I7 Q740 1.73Ghz | 6Go | GTX460m 1.5Go
User avatar
Refracty
Licensed Customer
Posts: 1599
Joined: Wed Dec 01, 2010 6:42 pm
Location: 3D-Visualisierung Köln
Contact:

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.
User avatar
Refracty
Licensed Customer
Posts: 1599
Joined: Wed Dec 01, 2010 6:42 pm
Location: 3D-Visualisierung Köln
Contact:

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?
tchoa
Licensed Customer
Posts: 189
Joined: Thu Jul 01, 2010 12:33 pm
Location: Montpellier

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
Win XP x64 | Q6600 2.40GHz | 8Go | GTX470 1.28Go // Win 7 x64 | I7 Q740 1.73Ghz | 6Go | GTX460m 1.5Go
User avatar
Refracty
Licensed Customer
Posts: 1599
Joined: Wed Dec 01, 2010 6:42 pm
Location: 3D-Visualisierung Köln
Contact:

Francois,
you are brillant as always.
Thank you for your help my friend :)
Post Reply

Return to “Autodesk Maya”