Exporting to .obj in Maya 2012 and textures and materials desappear in Prefab2

Software: Prefab3D

Mar, Newbie
Posted: 07 May 2013 11:24 AM   Total Posts: 29

Hi,

I am making an export of a car from Maya 2012 to Prefab2 with Obj exporter and it doesn’t include de textures or materials in it. A window pops up saying:

Oops! Issues were found during the parsing of this file:

1 subgeometry was found to have uv values out of bounds (0-1).
Repeat was set to true on the material using these uvs.
—————————————————————
List of meshes with uv changes:
—————————————————————
- Item x, material Submesh: 0, set repeat to true.

It keeps saying the same with every item that has a material established in Maya 2012.

I’m new in Maya and Prefab, can anybody help me please? It’s much easier for me to work the texture in Maya since I don’t know much AS yet, and Maya’s similar to other 3D programs I know. Is it a problem with exporting to many meshes in .obj format or should I export one by one each and every material to Prefab?

My goal is to be able to use a car made in Maya 2012 and finally have it in Away3D all finished, with textures and lights, and dynamic material reflexions (I don’t know if I used the correct words, sorry)

Thanks a lot, I would really mucha appreciate your help

   

Avatar
Fabrice Closier, Administrator
Posted: 07 May 2013 11:30 AM   Total Posts: 1265   [ # 1 ]

The “issue” is not a real problem at all. What it says is:
The model that you imported is uvmapped with values that are not between 0 and 1. Because of this, in Away, the map displayed on the mesh will likely be “visually” broken. To prevent the artefact, prefab simply set the repeat to true on the material for you.

 

   

Mar, Newbie
Posted: 07 May 2013 12:05 PM   Total Posts: 29   [ # 2 ]

You mean it’s just and advertisement of what Prefab is doing? That he is but changing that values to true so I won’t lose visually my textures on Away3D later on? Awesome! Thanks!

I also have a problem when I export. The thing is that I used symmetry to complete my other half of the car in Maya, so the name of the items are the same but they are actually not (they are symmetrical) in Maya is fine, but when I export to Prefab it gives me error in some meshes, like they’ve disappeared or flip over to their initial symmetry (I mean that they seem to be in place but they undo their symmetry) Is there any way to correct this?

Thanks a lot for your help

 

   

Mar, Newbie
Posted: 08 May 2013 01:47 PM   Total Posts: 29   [ # 3 ]

Even so, when I debug my AS file (from Prefab) with Flash Professional, I lose all my textures. I copied all the texture’s jpgs in myCar_Folder>Images (the one that Prefab creates for my project) and even if I change the nullpPlane1.jpg (by default in Prefab) on myCar.as file they still don’t appear, it gives me an error. Why is that so? How can I put back my textures in place on my actionscript file after Prefab erased them (writting directy it’s path doesn’t seem to work)? How can I do not to loose them when importing3D from Maya?

 

   

Avatar
Fabrice Closier, Administrator
Posted: 08 May 2013 03:22 PM   Total Posts: 1265   [ # 4 ]

if the usemtl tag is set for each mesh in obj, usually before first occurrance f tag, if the usemtl tag correspond to the one in mtl, and if the mtl has the url’s correct (so relative to obj file) then they will load. Look in process log to see if the url that Prefab attempts to load is correct (in case of errors), or if it tries at all!

 

   

Mar, Newbie
Posted: 09 May 2013 09:42 AM   Total Posts: 29   [ # 5 ]

Okey, I don’t know if i understood well but… When I save with Maya 2012 to .obj, it makes two files: an .mtl and an .obj file. I go to Prefab and Import 3D file Tire.obj (I’m trying with a simpler sample for now) and it apparently doesn’t open the .mtl which is the one that saves the textures and materials from Maya? How can I tell the program to set the usemtl tag for each mesh? I’ve looked in the Tool panel and in the material and meshes tabs but i can’t find it. Both files are in the same folder and named ‘Tire’ (Tire.mtl and Tire.obj)
Process Log says:

Try parse file with extension: .obj
url [file:///D:/RTT/AWAY3D/tire.obj]
Previous scenery elements cleared
object added to scene

Loaded and parsed obj file
url [file:///D:/RTT/AWAY3D/tire.obj]
AS3 classes export for Away3D version: 4.1
- export job starts
write Header
parsing objects
Ignoring Prefab’s root container3D
parse ObjectContainer3D ‘cont’
parse Mesh ‘pPlane0’
write material ‘pPlane1’
share material ‘pPlane1’
collectMaterial(s) mesh pPlane0
save dependency “dataASDReader.as”
encoding binary data [Pplane0Data.asd]
save dependency “data/asdPplane0Data.asd”
save dependency “dataPplane0Data.as”
parse Mesh ‘pCube0’
write material ‘pCube1’
share material ‘pCube1’
collectMaterial(s) mesh pCube0
encoding binary data [Pcube0Data.asd]
save dependency “data/asdPcube0Data.asd”
save dependency “dataPcube0Data.as”
parse Mesh ‘pasted__FrontWheelRight_16Inch_TireOutside0’
write material ‘pasted__FrontWheelRight_16Inch_TireInside’
share material ‘pasted__FrontWheelRight_16Inch_TireInside’
collectMaterial(s) mesh pasted__FrontWheelRight_16Inch_TireOutside0
encoding binary data [Pasted__frontwheelright_16inch_tireoutside0Data.asd]
save dependency “data/asdPasted__frontwheelright_16inch_tireoutside0Data.asd”
save dependency “dataPasted__frontwheelright_16inch_tireoutside0Data.as”
parse Mesh ‘pasted__FrontRight_Tire0’
share material ‘pasted__FrontWheelRight_16Inch_TireInside’
share material ‘pasted__FrontWheelRight_16Inch_TireInside’
collectMaterial(s) mesh pasted__FrontRight_Tire0
encoding binary data [Pasted__frontright_tire0Data.asd]
save dependency “data/asdPasted__frontright_tire0Data.asd”
save dependency “dataPasted__frontright_tire0Data.as”
parse Mesh ‘pasted__FrontWheelRight_16Inch_TireInside0’
share material ‘pasted__FrontWheelRight_16Inch_TireInside’
share material ‘pasted__FrontWheelRight_16Inch_TireInside’
collectMaterial(s) mesh pasted__FrontWheelRight_16Inch_TireInside0
encoding binary data [Pasted__frontwheelright_16inch_tireinside0Data.asd]
save dependency “data/asdPasted__frontwheelright_16inch_tireinside0Data.asd”
save dependency “dataPasted__frontwheelright_16inch_tireinside0Data.as”
parse Mesh ‘pasted__FR5’
save dependency “pasted__FR2.jpg”
write material ‘pasted__FR2’
share material ‘pasted__FR2’
collectMaterial(s) mesh pasted__FR5
encoding binary data [Pasted__fr5Data.asd]
save dependency “data/asdPasted__fr5Data.asd”
save dependency “dataPasted__fr5Data.as”
parse Mesh ‘pasted__FrontRimRight_PGQ_RimBodyInside0’
write material ‘pasted__FrontRimRight_PGQ_RimBodyInside’
share material ‘pasted__FrontRimRight_PGQ_RimBodyInside’
collectMaterial(s) mesh pasted__FrontRimRight_PGQ_RimBodyInside0
encoding binary data [Pasted__frontrimright_pgq_rimbodyinside0Data.asd]
save dependency “data/asdPasted__frontrimright_pgq_rimbodyinside0Data.asd”
save dependency “dataPasted__frontrimright_pgq_rimbodyinside0Data.as”
parse Mesh ‘pasted__FrontRimRight_PGQ_Vent0’
write material ‘pasted__FrontRimRight_PGQ_Vent’
share material ‘pasted__FrontRimRight_PGQ_Vent’
collectMaterial(s) mesh pasted__FrontRimRight_PGQ_Vent0
encoding binary data [Pasted__frontrimright_pgq_vent0Data.asd]
save dependency “data/asdPasted__frontrimright_pgq_vent0Data.asd”
save dependency “dataPasted__frontrimright_pgq_vent0Data.as”
parse Mesh ‘pasted__FR6’
write material ‘pasted__FR1’
share material ‘pasted__FR1’
collectMaterial(s) mesh pasted__FR6
encoding binary data [Pasted__fr6Data.asd]
save dependency “data/asdPasted__fr6Data.asd”
save dependency “dataPasted__fr6Data.as”
parse Mesh ‘pasted__FrontRimRight_PZO_RimCapEmblem0’
write material ‘pasted__FrontRimRight_PZO_RimCapEmblem’
share material ‘pasted__FrontRimRight_PZO_RimCapEmblem’
collectMaterial(s) mesh pasted__FrontRimRight_PZO_RimCapEmblem0
encoding binary data [Pasted__frontrimright_pzo_rimcapemblem0Data.asd]
save dependency “data/asdPasted__frontrimright_pzo_rimcapemblem0Data.asd”
save dependency “dataPasted__frontrimright_pzo_rimcapemblem0Data.as”
parse Mesh ‘pasted__FrontRimRight_PGQ_Bolt_II0’
write material ‘pasted__FR0’
share material ‘pasted__FR0’
collectMaterial(s) mesh pasted__FrontRimRight_PGQ_Bolt_II0
encoding binary data [Pasted__frontrimright_pgq_bolt_ii0Data.asd]
save dependency “data/asdPasted__frontrimright_pgq_bolt_ii0Data.asd”
save dependency “dataPasted__frontrimright_pgq_bolt_ii0Data.as”
parse Mesh ‘pasted__FR7’
share material ‘pasted__FR0’
share material ‘pasted__FR0’
collectMaterial(s) mesh pasted__FR7
encoding binary data [Pasted__fr7Data.asd]
save dependency “data/asdPasted__fr7Data.asd”
save dependency “dataPasted__fr7Data.as”
parse Mesh ‘pasted__FR8’
write material ‘pasted__FR’
share material ‘pasted__FR’
collectMaterial(s) mesh pasted__FR8
encoding binary data [Pasted__fr8Data.asd]
save dependency “data/asdPasted__fr8Data.asd”
save dependency “dataPasted__fr8Data.as”
parse Mesh ‘pasted__FR9’
share material ‘pasted__FR’

Could you please explain it to me like if I was a kid, please? I’m new at this and new programming so i’m a lil lost here. Thanks

 

   

Mar, Newbie
Posted: 10 May 2013 09:10 AM   Total Posts: 29   [ # 6 ]

Hi Fabrice,

I’ve been playing around in the meantime, and I tried, with a Lambert material, to texture a plane mapping with an asphalt.jpg and its corresponding bump mapping. Surprisingly for me, IT WORKED! I actually don’t know why or how, but it worked! I don’t understand why the asphalt texture was exported from Maya, but the aluminium phong with his reflected color wasn’t. First I thought it might be the type of material (matte and bright) but had nothing to do. Then I thought it might be about the polygons, maybe my wheels were made with polygons and my plane with DMM, so I made some basic shapes in both DMM (left) and polygons (right ones), and applied different materials and textures, but it also worked. The aluminium texture was exported this time to those basic shapes but not to my rims, and (nor the reflected color of the aluminium), so I’m assuming it might be about the meshed being too complicated.

I read you were talking about the flipped down UV maps http://away3d.com/forum/viewthread/2560/ I also have this problem too with just a few meshes of my car, could triangulate my meshes in Maya baking them work for both the aluminium problem in my rims and my 2 meshed flipped down?

It’s weard because some times I can see the materials in Prefab exporting from Maya and some others not.

 

   

Avatar
Fabrice Closier, Administrator
Posted: 10 May 2013 10:34 AM   Total Posts: 1265   [ # 7 ]

Glad you found a way to make it work. There is no trace of dependency error in your log, so obviouly the obj doesn’t hold the mtl information.

If you mirror your data, why not import just only one side of the car, one wheel. Import in Prefab, make your materials, save your project. Then export as as3. You can access the wheel by looping over the class.meshes, and you could mirror by code. The 4.1 version of the Mirror class has been improved, so you could save on data size…

The flip on uv is often caused by right to left handed coordinate system.
I’m currently working on something for the next release that will likely help you for this…

 

   

Mar, Newbie
Posted: 17 May 2013 10:44 AM   Total Posts: 29   [ # 8 ]

Well, I’m actually trying to directly transfer my materials and textures from Maya because it is much easier for me to use a 3D program than a code language I barely know (AS). I’ve been trying it with other than Lambert material since I want a shinny one for my metal parts like Phong or Blinn. But it doesn’t work. Also my mental ray materials dessappeared completely.

Now I’m simply exporting the .ma to .obj and in Prefab arranging all the materials I’ve lost on the way, and also it’s properties but I seem only to be able to modify the diffuse, normal and specular, and also the alpha (which I have none) ambient color and specular color (which I don’t need either) How can I tell if the materials (asides from the bitmap that weren’t attached to my obj) have at least the same properties I configured in Maya? Can I render in high quality in Prefab somewhere?

I mirrored some parts of my car, like you suggested, but only the ones that were giving me some trouble with the flipped down UVs and I’ve been almost 2 hours trying to export my work from Prefab to AWD2, and it still says 1%. Is it normal that it’s taking so long? is it a problem with the bitmaps I added on specular in Prefab?

 

   

Avatar
Fabrice Closier, Administrator
Posted: 17 May 2013 11:23 AM   Total Posts: 1265   [ # 9 ]

The obj parser supports only a few of the mtl material tags. Dedicated Methods are simply ignored (see OBJParser mtl parsing part).
If maps are not restored its probably because the mtl url of the maps is not relative to obj file, but pointing to a specific location on your drive.
Mental ray definition or similar are ignored as there is no equivallent in Away3D.

if your maps are big, like 2048, export may take some time, but if its stuck for a long while on 1% its probably because an unhandled error occured, and export process freezes. Send me your project directory (located in your user/preafb2/projects/projectname) + your steps before export, so I can try to reproduce.

Can I render in high quality in Prefab somewhere?
Prefab has no rendering to bitmap option (raytrace like). What you see is what you will get rendered in your project.

 

   

Mar, Newbie
Posted: 17 May 2013 12:09 PM   Total Posts: 29   [ # 10 ]

I thought it may be loading so slow because of the images too, but I reduced them to 512x512 and it was freezed too. I just erased the file in obj and made it again, and restart Prefab2. This time it worked, I was able to save my .as file. But when I debug it in Flash, it gives me an error.

My compiler shows me this error:
Line 408 1046: Type was not found or was not a compile-time constant:_switch_antennaData.
Line 414 1046: Type was not found or was not a compile-time constant:_switch_antenna0Data.
Line 420 1046: Type was not found or was not a compile-time constant:_switch_antenna1Data.
Line 426 1046: Type was not found or was not a compile-time constant:_switch_antenna2Data.

I checked myproject.as file and this is what I have:

407 antenna_a.subMeshes[0].material = getMaterialFromID(“EXT252”);
408 var _switch_antenna2Data:_switch_antenna2Data = new _switch_antenna2Data();
409 var geom_switch_antenna2:Geometry = _switch_antenna2Data.geometryData;
410 var _switch_antenna2_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);
411 var _switch_antenna2:Mesh = buildMesh(geom_switch_antenna2, _switch_antenna2_rd, “_switch_antenna2”, getMaterialFromID(“EXT252”), cont);

413 _switch_antenna2.subMeshes[0].material = getMaterialFromID(“EXT252”);
414 var _switch_antenna1Data:_switch_antenna1Data = new _switch_antenna1Data();
415 var geom_switch_antenna1:Geometry = _switch_antenna1Data.geometryData;
416 var _switch_antenna1_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);
417 var _switch_antenna1:Mesh = buildMesh(geom_switch_antenna1, _switch_antenna1_rd, “_switch_antenna1”, getMaterialFromID(“EXT252”), cont);

419 _switch_antenna1.subMeshes[0].material = getMaterialFromID(“EXT252”);
420 var _switch_antenna0Data:_switch_antenna0Data = new _switch_antenna0Data();
421 var geom_switch_antenna0:Geometry = _switch_antenna0Data.geometryData;
422 var _switch_antenna0_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);
423 var _switch_antenna0:Mesh = buildMesh(geom_switch_antenna0, _switch_antenna0_rd, “_switch_antenna0”, getMaterialFromID(“EXT252”), cont);

425 _switch_antenna0.subMeshes[0].material = getMaterialFromID(“EXT252”);
426 var _switch_antennaData:_switch_antennaData = new _switch_antennaData();
427 var geom_switch_antenna:Geometry = _switch_antennaData.geometryData;
428 var _switch_antenna_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);
429 var _switch_antenna:Mesh = buildMesh(geom_switch_antenna, _switch_antenna_rd,“_switch_antenna”, getMaterialFromID(“EXT252”), cont);

What is even a _switch_antennaData? I’m assuming it’s some kind of geometry, but since it changes all the names I don’t know what he is talking about. I’m new with actionscript and Flash Professional, but could you please tell me what Prefab is refering to when calling _switch_antennaData so I can know what’s going on? Or even better if you know how to fix it.

Thanks

 

   

Avatar
Fabrice Closier, Administrator
Posted: 17 May 2013 12:45 PM   Total Posts: 1265   [ # 11 ]

Prefab export the project to as3 either in the directory that you pick or same but generates a directory.
so if you give the name “myThing”
if you let the default “export in folder”, you end up on the selected dir having al the files into a folder “mything”, the “Mything.as” is inside it.
if you have unchecked, the entire export will be written into the dir that you’ve picked.
So if you have exported with folder, you need to move the content to one level upper or whatever structure you have in your project.
because if you have made a ‘models’ package, has said in export that the package is ‘models’, if you try to import models.Mything, Mything.as needs to be there. if you let the folder and import like models.myThing.MyThing, it will not work, because the imports of the as3 do not know anything about the encapsulating folder (you could specify that into the package field, by entering ‘models.myThing’ however would work)
It is there optional to prevent that you end up with a mess. Like exporting multiple times to desktop. How would you know which files belongs to which export? Unchecking it however (it was requested many times), is a way to say: I’m in control, I know how as3 works, I want write the whole thing in there.
You do not have to worry about the extra classes, they are there to managed the compagnon binaries asd’s. If they fail as in yoru above error stack it is because of the faulty imports.

 

   

Mar, Newbie
Posted: 20 May 2013 11:53 AM   Total Posts: 29   [ # 12 ]

I don’t think I understand…

This is my workflow:

1-Open my Maya2012 file: My_Car.ma and select objects I want to export.
2-Go to File>Export selection. I name my file: My_Car and files of type: OBJ export. (My_Car.obj). Choose my file location D:\AWAY3D\projects. Click on Export selection.
3-I open my Prefab3D version2. Go to File>Import 3D file and locate my OBJ file in D:\AWAY3D\projects. Open. Then it pops up a window saying:

  Oops! issues where found during the parsing of this file:
  6 bitmaps were corrected after they were loaded. Their respective sizes     were set to nearest power of two size.
  —————————————————————
  List of rescaled maps:
  —————————————————————
  - parquet.jpg
  - alum.jpg
  - alum.jpg
  - concrete.jpg
  - metal scratch rust texture (17).jpg
  - white marble.jpg

  52 subgeometries were found to have uv values out of bounds.
  Repeat was set to true on the materials using these uvs.
  —————————————————————
  List of meshes with uv changes:
  —————————————————————
  - pasted__pasted__GroundShadow_Plane, material Submesh: 0, set   repeat to true.
  - My_Car13, material Submesh: 0, set repeat to true.
  - My_Car42, material Submesh: 0, set repeat to true.
  - EXT14, material Submesh: 0, set repeat to true.
  - EXT24, material Submesh: 0, set repeat to true.
  - EXT27, material Submesh: 0, set repeat to true.
  - EXT30, material Submesh: 0, set repeat to true.

Click Close.

4-Then I check my 3D geometry and Geometry>Mirror all the pieces that were lost in the export step. Choose my coordinate axis and apply mirror.
5-I then go to Exports>Export AS3 Class> Away3D 4.x I give it a Class name: My_Car.as (with the ‘write files in a folder’ selected). And click Save AS3.
6-I now got to Flash Professional, my Car_5.fla file, and File>ActionScript Settings… in the source path tab, I add D:\AWAY3D\projects\My_Car (folder) Click okey and Save Car.fla
7-In my actionscript file class named Car_5.as I code:

package {

import away3d.containers.*;
import away3d.controllers.*;
import away3d.entities.*;
import away3d.materials.*;
import away3d.primitives.*;
import away3d.utils.*;
import away3d.cameras.*;
import away3d.loaders.Loader3D;
import away3d.events.LoaderEvent;
//import away3d.loaders.parsers.ParserBase;
import away3d.loaders.parsers.Parsers;
import away3d.lights.*;
import away3d.materials.lightpickers.StaticLightPicker;
import away3d.tools.utils.TextureUtils;

import My_Car;

import flash.display.*;
import flash.events.*;
import flash.geom.Vector3D;
import flash.net.URLRequest;

import away3d.textures.CubeTextureBase;
import flash.display.BitmapData;

[SWF(backgroundColor=”#000000”, frameRate=“60”, quality=“LOW”)]

public class Car_5 extends MovieClip
{    //engine variables
  private var _view:View3D;
 
  private var _loader:Loader3D;
  private var _model:My_Car;
 
  //scene objects
  //private var _plane:Mesh;
 
  //private var container:Sprite;
  //private var test:Shape;
  private var scene:Scene3D;
  private var camera:Camera3D;
  private var cameraController:HoverController;
 
  //navigation variables
  private var move:Boolean = false;
  private var lastPanAngle:Number;
  private var lastTiltAngle:Number;
  private var lastMouseX:Number;
  private var lastMouseY:Number;
 
  //light objects
  private var light1:DirectionalLight;
  private var light2:DirectionalLight;
  private var lightPicker:StaticLightPicker;
 
          public function Car_5()
  {
  stage.scaleMode = StageScaleMode.NO_SCALE;
  stage.align = StageAlign.TOP_LEFT;
 
  //setup the view
  _view = new View3D();
 
  scene = new Scene3D();
 
  camera = new Camera3D();
 
  _view.scene = scene;
  _view.camera = camera;
 
  Parsers.enableAllBundled();
 
  cameraController = new HoverController(camera);
  cameraController.distance = 200;
  cameraController.minTiltAngle = 0;
  cameraController.maxTiltAngle = 90;
  cameraController.panAngle = 45;
  cameraController.tiltAngle = 20;
 
  initLights();

                //setup the camera
  _view.camera.z = -600;
  _view.camera.y = 500;
  _view.camera.lookAt(new Vector3D());

                _model = new My_Car();
 
  _view.scene.addChild(_model)
 
  this.addChild(_view);

                addEventListener(Event.ENTER_FRAME, _onEnterFrame);
  stage.addEventListener(MouseEvent.MOUSE_DOWN,  onDown);
  stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
  stage.addEventListener(Event.RESIZE, onResize);
  onResize();
 
  }
private function initLights():void
  {
  light1 = new DirectionalLight();
  light1.direction = new Vector3D(0, -1, 0);
  light1.ambient = 0.1;
  light1.diffuse = 0.7;
 
  scene.addChild(light1);
 
  light2 = new DirectionalLight();
  light2.direction = new Vector3D(0, -1, 0);
  light2.color = 0x00FFFF;
  light2.ambient = 0.1;
  light2.diffuse = 0.7;
 
  scene.addChild(light2);
 
  lightPicker = new StaticLightPicker([light1, light2]);
  }
 
  private function onLoadError(ev : LoaderEvent) : Boolean
  {
  trace(‘onLoadError’);
  trace(‘Could not find’, ev.url);
  if (hasEventListener(LoaderEvent.LOAD_ERROR)) {
  dispatchEvent(ev);
  return true;
  }
  else {
  return false;
  }
  }

  private function onResourceComplete(ev : Event) : void
  {
                trace(‘onResourceComplete’);
          }
 
  private function onClickRect(e:MouseEvent):void
  {
 
  }


and 4 other functions more. I save changes and Debug it. And it shows me the compiler error I wrote you above with this infront: D:\AWAY3D\projects\My_Car\My_Car.as, Line…

I tried to copy the My_Car.obj and it’s .mtl file inside My_Car folder (the one that Prefab created for me) but it still doesn’t work.

Inside My_Car folder there’s:
-data folder
-image folder
-ASBase.as file
-My_Car.as
-PrefabProject.as

Thanks

 

   

Avatar
Fabrice Closier, Administrator
Posted: 20 May 2013 07:51 PM   Total Posts: 1265   [ # 13 ]

“I don’t think I understand…”

first:
you import My_Car;
BUT and I told you already, you have the option “write in folder on”
so this folder is NOT added to packages!!
so export again from prefab and enter in package textfield “somename”

if you export, with “write folder on”, place this folder next to your main.as
rename the folder exactly as you defined in Prefab. “somename”

if you do not export with “write folder on”, make a directory next to your main.as and name it “somename”. In prefab, save inside this folder.

in your main.as
import somename.My_Car;

Then and only then if you follow these basic AS3 rules, you will no longer have errors.


Second:
forgot about your obj!
once its exported as AS3, you no longer need the obj/mtl. That’s the whole point of AS3 exports! So get rid of all loader3df related stuffs in your code.

A typical class is just declaring a view, and addChilding the class to the view scene.

class{
  import somePackage.MyExport;

  function SomeClass(){
    declareViewAsUsual();
   
    view.scene.addChild( new MyExport() );
  }
}

note :The same class would work if you change the import by the PrefabProject class


The warnings you get in Prefab are not of importance.
Its just you use maps that are not suitable for Away3D and Prefab corrects this for you. You mapping is not suitable for non repeated material.

 

 

 

   

Mar, Newbie
Posted: 24 May 2013 02:02 PM   Total Posts: 29   [ # 14 ]

Hi Fabrice,

I tried every thing you said several times, so did my colleague and we weren’t able to succeed on it. It gives us continuous error on AS, some of them nonsence. There seems to be some data that it doesn’t recognize although the data.as is in the data folder, and so on. Thanks anyway.

I started all over, I’m gonna export in groups my car: mainbody, instances, paint, glass, etc. And try to load them all together in my main As file later on, and apply the mirror and materials by code. I just have one more problem with Prefab. I’ve imported to Prefab my paintInstance.obj file, for example, and even though each piece had it’s own name in my Maya file, it seems to change that name when importing to Prefab, I tried to change them again in Prefab but when I change one name, it changes 2 or 3 too naming them for example: Hood_Cover, Hood_Cover0, Hood_Cover1, when I only have ONE Hood_Cover. It automatically changes the name of other pieces for me, how can I avoid this from happening? It’s crazy to try to organize anything like this. I have like 80 pieces and I can’t them to have their own name so I won’t go crazy later on in AS to know what is each one of them.

Thanks a lot for your help

 

   

Avatar
Fabrice Closier, Administrator
Posted: 24 May 2013 02:25 PM   Total Posts: 1265   [ # 15 ]

K, send me your project file (the entire directory located in prefab2/projects/yourprojectname)
I’ll export and setup a basic demo class that uses it for you.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X