[Papervision3D] Modo and COLLADA export-plugin support in PV3D

Robby Abaya rabaya at gmail.com
Wed Jun 20 16:38:18 EDT 2007


Thank you so much for this!

On 6/20/07, Wille Frankenhaeuser <wille at sulake.com> wrote:
> Hello,
>
> first post, so I'll just like to congrat on the great work!
>
> I had a look at exporting COLLADA from Modo 203.
> There exists a very nice Lua-plugin created by Huidafa which you can
> download from Vertexmonkey:
> http://www.vertexmonkey.com/downloads/general/IO/exportCollada_v1.4R3.zip
>
> However the Lua-script needed to be tweaked a bit for PV3D, for instance
> output triangles instead of polygons.
> Simple enough, in the Lua-script I made 3 changes:
> 1.)
> -- First in the Main Entry (Bottom of Script):
> lx("select.type polygon")
> lx("poly.triple")
> 2.)
> -- inside function WritePolygons, change opening and closing tags for
> <polygons/> to <triangles/>
> 3.)
> Change
> UpAxis = [[Z_UP]]
> to
> UpAxis = [[Y_UP]]
>
>
>
> In PV3D I made the following modifications to Collada.as:
> 1) Read in vertices defined in several <p>-elements
>
> Collada.as, line ~304:
>             // var data     :Array  = triangles.p.split(' ');
>             var data     :Array  = new Array();
>             for each( var p:String in triangles.p )
>             {
>                 data = data.concat( p.split(' ') );
>             }
>
>
> 2) Convert whitespace (/n/r/t/s) to a single-space character.
> This includes the vertices for the Mesh, Normals and UV-coordinates for
> textures.
>
> Collada.as, #deserialize, before defining floats-array, line ~592:
>
>             // Convert any white-space to spaces
>             var pattern:RegExp = /\s{1,}/g;
>             floStr = floStr.replace(pattern, " ");
>
>
>
> What do you think? Obviously RegExp-stuff is AS3-only, but doable in AS2
> as well.
>
>
> It seems that PV3D doesn't support shading-materials defined in the
> COLLADA-file (issues warning: "Material xxx not found"),
> I guess for the time being the current solution is to add the materials
> manually when loading the file:
>
> var list:MaterialsList = new MaterialsList();
> var clr:ColorMaterial = new ColorMaterial(0x00ff00, 1);
> list.addMaterial(clr, "Mesh1Material");
> new Collada( "meshes/" + this.scenePath, list )....
>
>
> The open-source tool Meshlab <http://meshlab.sourceforge.net/> shows the
> file correctly.
>
>
> Kind regards,
> Wille Frankenhaeuser
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>



More information about the Papervision3D mailing list