Hey Ian
I expect the reason your debug isn't working is you're missing the correct
import in the actionscript - cs3 helpfully ignores classes that it doesn't
know where to get from, so you have to know these things and input them
manually. I tend to forget this after working in flexbuilder for so long ;)
if you insert this at the top of your code, the debug should work
import away3d.core.utils.Debug;
then you should see the traces and get the correct names!
Away3d and Papervision are probably about the same in terms of learning
curve, although it does depend on how you approach things with your own
coding styles. I think the main thing that sets us apart is support - we
always try to respond to bug reports and fix them immendiately whereever
possible. The goal with Away3d has always been stability, ease of use, and
features. Probably in that order ;)
Glad you liked the FOTB pres! If you ever want to revisit the content
showcased, the majority of demos shown were taken either from my blog
infiniteturtles.co.uk or the away3d.com site. We try to provide sources
wherever possible, and currently have some demos as work in progress that
should assist people just starting out, in order to make things a little
easier initially. obviously more info will be released on that soon
atb
Rob
On Wed, Oct 29, 2008 at 12:34 PM, Albinal <[EMAIL PROTECTED]> wrote:
>
> This seems better but now I am getting:
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>
> So I'm assuming I'm not referencing the material name/id quite
> right!?!
>
> This is what it says in my DAE:
>
> <library_images>
> <image id="BodyDefault_png-img" name="BodyDefault_png-img">
> <init_from>BODY.png</init_from>
> </image>
> </library_images>
> <library_materials>
> <material id="BodyDefault_png" name="BodyDefault_png">
> <instance_effect url="#BodyDefault_png-fx"/>
> </material>
> </library_materials>
>
> I am using "BodyDefault_png" as my material name as this is what
> worked in Papervision.
>
> I literally slapped that debug code (Debug.active = true;) in at the
> top?!? I wasn't aware I had to do anything else. I have more of a
> design brain than a programming one, though I am learning...
> slowly. ;-)
>
> Many thanks again Rob! By the way, I'm giving Away 3D a go after
> seeing your talk at FOTB... I was very impressed! :-)
>
> Away 3D seems a lot more user-friendly than Papervision but I suppose
> that depends on whether or not I can get my project to work!
>
> Ian
>
>
>
> On Oct 27, 3:51 pm, "Rob Bateman" <[EMAIL PROTECTED]> wrote:
> > The material returned in the getMaterial method can be any number of
> > diferent types, whcih is why is it case as the geenric material type. If
> you
> > are accessing materials that are bitmap textures, you can cast the
> returned
> > material to BitmapMaterial before accessing properties, like so:
> >
> > var myBitmapMaterial:BitmapMaterial =
> > materialLibrary.getMaterial("theIdFromTheDAE").material
> > as BitmapMaterial
> >
> > myBitmapMaterial.smooth = true;
> >
> > this should get rid of your error.
> >
> > Unfortunately you haven't given enough information on how you are
> activating
> > debug mode to see what the problem might be there!
> >
> > atb
> >
> > Rob
> >
> >
> >
> > On Mon, Oct 27, 2008 at 3:07 PM, Albinal <[EMAIL PROTECTED]>
> wrote:
> >
> > > Thanks. But unfortunately I can't get it to work. I have this error:
> > > 1119: Access of possibly undefined property smooth through a reference
> > > with static type away3d.materials:IMaterial.
> >
> > > I looked at the IMaterial.as file but it didn't really help?!? Do I
> > > also have to update my material or something?!?
> >
> > > I also couldn't get the debug to work?!?
> >
> > > Elye
> >
> > > On Oct 22, 11:44 pm, "Rob Bateman" <[EMAIL PROTECTED]> wrote:
> > > > on the loaded ObjectContainer3D or the Object3DLoader itself is the
> > > > materialLibrary property:
> >
> > > > materialLibrary.getMaterial("theIdFromTheDAE").material.smooth =
> true;
> >
> > > > a bit more long winded, but having the material as a property of the
> > > library
> > > > object allows us to replace the material if we so wish like this:
> >
> > > > materialLibrary.getMaterial("theIdFromTheDAE").material = new
> > > > BitmapMaterial(myBitmap);
> >
> > > > which can be handy too.
> >
> > > > a lot of the time the id and name attributes are the same for
> materials
> > > and
> > > > objects in a collada file. But just in case they're not, the loader
> > > always
> > > > uses the id attribute of the collada items for the names of objects
> and
> > > > materials.
> >
> > > > if you prefer not to go rooting around in xml for object and material
> > > names,
> > > > you can do the following at the start of your application:
> >
> > > > Debug.active = true;
> >
> > > > this puts Away3d into debug mode, using the trace window to output
> data
> > > > about various events. In the case of a collada file loading, the
> names of
> > > > all parsed materials, bones, containers and mesh objects are output,
> > > helping
> > > > you find the right name for your material.
> >
> > > > hth
> >
> > > > Rob
> >
> > > > On Wed, Oct 22, 2008 at 3:04 PM, Albinal <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > If I am loading a texture through my DAE how do I set the texture
> to
> > > > > smooth? In Papervision they have something like
> > > > > "GetMaterialByName("theNameFromTheDAE").smooth = true;
> >
> > > > > Many thanks!
> >
> > > > > Elye
> >
> > > > --
> > > > Rob Bateman
> > > > Flash Development & Consultancy
> >
> > > > [EMAIL PROTECTED]
> >
> > --
> > Rob Bateman
> > Flash Development & Consultancy
> >
> > [EMAIL PROTECTED]
>
--
Rob Bateman
Flash Development & Consultancy
[EMAIL PROTECTED]
www.infiniteturtles.co.uk
www.away3d.com