Export particles as matrices

Forums: Export particles as matrices
Blender (Export script developed by yoyoz; Integrated Plugin developed by JimStar)

Export particles as matrices

Postby steveps3 » Wed Jul 25, 2012 10:07 pm

steveps3 Wed Jul 25, 2012 10:07 pm
Ok guys, here it is, Version 1 of my particles as matrices script.

First let me say that there is a bit of a bug in it. There is something not 100% in my math which generates the matrix. The result is that the object is becoming skewed. If anyone would like to take a look at the script and if they can spot the error then please let me know or fix it and repost.

Ok, here is what you need to do. The script can be installed as an add-on in the same way as any other blender add-on. It will appear in the "import-export" section of the add-ons list. There is another bug here in that I am unable to tick to include the "Export particles as matrixes" (excuse the typo, I will fix it sometime) add-on. So I think that every time that you run blender you will have to go into the add-ons and tick the add-on. This doesn't actually tick it but it does appear to activate it. Again if someone can fix this then that would be great.

Once you have it installed then create an object and add a particle system to it. set the system up how you want and when you are happy with it press space and type in "export matrices" and select it from the menu. Once it is running you will see an export window appear where you can tell the script what name to give the export file. When you are happy press the "export Matrices" button and all of you particle data will be output to the file in matrix format. All you then need to do is open the file and copy the contents into the scatter node in Octane. Bingo, lovely instances.

As I say, version 1. Please play with it. Please report any bugs. Please fix the bugs if you are up to it because I am not a python programmer. Just this script has taken me about 7 hours to cobble together from various places. There is that bug in the math which is causing the object to skew but I am tired and I've had enough of this thing for tonight. At least it is almost there.

Happy scattering
Steve
Attachments
Capture.JPG
partasmatrix.zip
(1.62 KiB) Downloaded 118 times
(HW) Intel i7 2600k, 16GB DDR3, MSI 560GTX ti (2GB) x 3
(SW) Octane (1.50) Blender (2.70) (exporter 2.02)
(OS) Windows 7(64)
User avatar
steveps3
Licensed Customer
Licensed Customer
 
Posts: 1118
Joined: Sat Aug 21, 2010 4:07 pm
Location: England

Re: Export particles as matrices

Postby ROUBAL » Thu Jul 26, 2012 11:11 am

ROUBAL Thu Jul 26, 2012 11:11 am
Hi Steveps3,

Thank you for your effort, but all I get when attempting to export as matrix is an error message. I don't see anything else running.

I have created a subdivided deformed plane (ground) and a grass tuft as particle object duplicated by the particle system.
Attachments
Matrix.jpg
French Blender user - CPU : intel Quad QX9650 at 3GHz - 8GB of RAM - Windows 7 Pro 64 bits. Display GPU : GeForce GTX 480 (2 Samsung 2443BW-1920x1600 monitors). External GPUs : two EVGA GTX 580 3GB in a Cubix GPU-Xpander Pro 2. NVidia Driver : 368.22.
User avatar
ROUBAL
Licensed Customer
Licensed Customer
 
Posts: 2199
Joined: Mon Jan 25, 2010 5:25 pm
Location: FRANCE

Re: Export particles as matrices

Postby steveps3 » Thu Jul 26, 2012 12:24 pm

steveps3 Thu Jul 26, 2012 12:24 pm
I will have to have a look into it. I've managed to do some tweaking to the script and have fixed some of the bugs. Sadly I am pretty much working in the dark and google is proving to be far from helpful. What would be useful is if someone who actually knew what they were doing could have a look and maybe fix a few of the problems.

I've attached the latest version of the script but i don't think that it will cure your problem.
Attachments
partasmatrix.zip
(1.55 KiB) Downloaded 118 times
(HW) Intel i7 2600k, 16GB DDR3, MSI 560GTX ti (2GB) x 3
(SW) Octane (1.50) Blender (2.70) (exporter 2.02)
(OS) Windows 7(64)
User avatar
steveps3
Licensed Customer
Licensed Customer
 
Posts: 1118
Joined: Sat Aug 21, 2010 4:07 pm
Location: England

Re: Export particles as matrices

Postby steveps3 » Thu Jul 26, 2012 12:29 pm

steveps3 Thu Jul 26, 2012 12:29 pm
Could you send my your .blend so that I can give it a try.

Cheers
(HW) Intel i7 2600k, 16GB DDR3, MSI 560GTX ti (2GB) x 3
(SW) Octane (1.50) Blender (2.70) (exporter 2.02)
(OS) Windows 7(64)
User avatar
steveps3
Licensed Customer
Licensed Customer
 
Posts: 1118
Joined: Sat Aug 21, 2010 4:07 pm
Location: England

Re: Export particles as matrices

Postby matej » Thu Jul 26, 2012 1:15 pm

matej Thu Jul 26, 2012 1:15 pm
@Roubal, I believe you get that error because you don't have the emitter object selected when you run the script. The script needs the emitter to be the active (selected in viewport) object.

There is also the problem of registering the addon. For me it didnt work, because the module needs a register() function, like so in this case:

Code: Select all
def register():
   bpy.utils.register_class(ExportMatrices)
   bpy.types.INFO_MT_file_export.append(menu_func)
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
User avatar
matej
Licensed Customer
Licensed Customer
 
Posts: 2083
Joined: Fri Jun 25, 2010 7:54 pm
Location: Slovenia

Re: Export particles as matrices

Postby radiant » Thu Jul 26, 2012 4:05 pm

radiant Thu Jul 26, 2012 4:05 pm
Works perfectly for me (cant see it in the export menu though)
Im going to be honest, its 1 am and i only did one render, but it works, the scatter and the placement.
All we need to do now is try and get the rotation working ;)
Win8 Pro 64bit ULT|Intel Core i7 3930K|3.20 GHz|32 GB RAM|GTX 590|UD5 2011 socket||2x TB HD||Master Cooler HAF X||Blender 2.6||Maya 2012||Octane|
User avatar
radiant
Licensed Customer
Licensed Customer
 
Posts: 699
Joined: Mon Apr 05, 2010 12:00 pm
Location: Adelaide, Australia

Re: Export particles as matrices

Postby ROUBAL » Thu Jul 26, 2012 5:54 pm

ROUBAL Thu Jul 26, 2012 5:54 pm
@matej : I tried with emitter active, with object active and with both active as well...
French Blender user - CPU : intel Quad QX9650 at 3GHz - 8GB of RAM - Windows 7 Pro 64 bits. Display GPU : GeForce GTX 480 (2 Samsung 2443BW-1920x1600 monitors). External GPUs : two EVGA GTX 580 3GB in a Cubix GPU-Xpander Pro 2. NVidia Driver : 368.22.
User avatar
ROUBAL
Licensed Customer
Licensed Customer
 
Posts: 2199
Joined: Mon Jan 25, 2010 5:25 pm
Location: FRANCE

Re: Export particles as matrices

Postby steveps3 » Thu Jul 26, 2012 8:26 pm

steveps3 Thu Jul 26, 2012 8:26 pm
Ok, here is version 2 which (fingers crossed) works.

Please let me know if there are any bugs. I think that I've ironed them out. The skewing is certainly fixed as are the typos. Also an added bonus it won't export particles that are not alive.

I'd love to see any examples of work created that was created with this script.

Cheers guys
Steve

Oh yes, registering has been fixed as well.
Attachments
partasmatrix.zip
(1.59 KiB) Downloaded 119 times
(HW) Intel i7 2600k, 16GB DDR3, MSI 560GTX ti (2GB) x 3
(SW) Octane (1.50) Blender (2.70) (exporter 2.02)
(OS) Windows 7(64)
User avatar
steveps3
Licensed Customer
Licensed Customer
 
Posts: 1118
Joined: Sat Aug 21, 2010 4:07 pm
Location: England

Re: Export particles as matrices

Postby steveps3 » Thu Jul 26, 2012 8:31 pm

steveps3 Thu Jul 26, 2012 8:31 pm
If proof was needed, here is a very quick render. Lots of lovely rotation and new skewing.
Attachments
scatter.png
(HW) Intel i7 2600k, 16GB DDR3, MSI 560GTX ti (2GB) x 3
(SW) Octane (1.50) Blender (2.70) (exporter 2.02)
(OS) Windows 7(64)
User avatar
steveps3
Licensed Customer
Licensed Customer
 
Posts: 1118
Joined: Sat Aug 21, 2010 4:07 pm
Location: England

Re: Export particles as matrices

Postby steveps3 » Thu Jul 26, 2012 8:52 pm

steveps3 Thu Jul 26, 2012 8:52 pm
Ok, I have been doing a bit more testing and it looks like some of my rotations are amiss. They are rotating the wrong way. I'll see what I can do.
(HW) Intel i7 2600k, 16GB DDR3, MSI 560GTX ti (2GB) x 3
(SW) Octane (1.50) Blender (2.70) (exporter 2.02)
(OS) Windows 7(64)
User avatar
steveps3
Licensed Customer
Licensed Customer
 
Posts: 1118
Joined: Sat Aug 21, 2010 4:07 pm
Location: England
Next

Return to Blender


Who is online

Users browsing this forum: No registered users and 3 guests

Thu Jul 02, 2020 8:50 am [ UTC ]