flex

Papervision Collada Viewer (made in Adobe Air)

by anthonyScavarelli on May.09, 2009, under Air, actionscript, flex

Well, I have been stuck working on some other things lately (like trying to fix the bottom bracket of my bike :( and am currently still working on my linkages tutorial. Just trying to determine how is the best way to present it (I’m new eh – Canadian for emphasis ;). In the meantime, I am going to give everyone interested in bringing 3D models into Papervision a present:

An air app that allows one to load and edit Collada animated/non-animated models!

Screenshot of Collada Application

This was a project I built in a few weeks between projects, while working as an intern at Fuel Industries. As it seems not all Collada models exported from 3D packages such as Blender, 3DMax, and Autodesk’s Maya load properly, I figured building a robust app that could install on any machine for 3D artists to test out their models before any flash/flex work would be a time saver.

Anyhow, I ran out of time and could not add some features such as undo states, loading other types of models (MD2, 3DX et cetera), and the ability to know why a model would fail to load properly. But I am going to include the entire Flex project so that if anyone wants to add any features to it go right ahead. Please feel free to comment back with the changes you have made and some code so others can build upon it, if you can.

This is the current list of features:

  • load a Collada model from a local source
  • scale, rotate, or orbit model using mouse controls
  • ability to auto-texture
  • manual texturing includes ability to turn off and on wireframe or flat colour
  • ability to play through animations, frame-by-frame, or as would be expected
  • ability to open up a secondary window that shows loaded models Collada .DAE data
  • ability to edit and save .DAE data (in XML format).

Hopefully you can find this useful. If you do let me know.

Here is the air app with transparent windows enabled
Here is the air app with transparent windows disabled (runs better on slow machines)

Here is the entire Flex project (unzip and import existing project in Flex Builder)
And some sample Collada models

(And if you don’t have the Air framework installed already you will need it before you can install any Adobe Air applications. Get it here: http://get.adobe.com/air/ )

Enjoy! :)


NOTE: If you are having troubles building the project make sure to check out which version of Flex Builder you are using. I did not update FB3 while building this so the line in the ColladaAirViewer-app.xml is

<application xmlns="http://ns.adobe.com/air/application/1.1">

You may have to change it to:

<application xmlns="http://ns.adobe.com/air/application/1.5">
2 Comments :, , , more...

Introduction to “the beauty of it all”

by anthonyScavarelli on Apr.22, 2009, under Uncategorized, flash, flex

Hello,

Well, my first blog post ever. Figured it was about time I started posting some actionscript tips I have learned along my flash and flex learning journeys. It is a great way to share knowledge (both for you, the reader, hopefully, and myself as well. This as some of you may give your own take on the subjects). My goal is start with relatively basic tasks, and build up to more complex examples involving Papervision and such – that this blog could help one learn how to code in Flash, as I feel there are fundamentals that are glazed over when it comes to teaching the basics of Flash. The truth is, that all the coolest tricks in Flash go far beyond simple tweens and buttons and right into leveraging actionscript into creating and customizing your own effects. But there are fundamentals that will make yours, and others you may work with in the future, lives easier when working in Flash and Flex projects. I will try my best throughout all my blog posts to make the three following rules a point of focus in all my tutorials:

  1. putting no more code than, maybe “stop();” on the Flash timeline.
  2. highly organized structure of all assets used in the creation of projects.
  3. object oriented programming (using an event-driven model).
flash logo

It is important to stay away from the allure of putting code on the timelines as it is harder to change that code later, and Flex itself, will not recognize any timeline code on embedded movieclips (best to get used to it in Flash so there are no nasty surprises in Flex). Proper organization of all flash projects is essential in making everyone’s lives easier when it comes to re-tooling projects or changing things. And if all the coolest effects are programmatic then it would be best to follow, arguably, the cleanest and most easily understandable coding practises – this would be object-oriented programming or OOP for short. And seeing as how Flash and Flex are both built upon the concept of “something” triggering an event that will cause some other code to execute, it would be ideal to push the event-driven model of coding, as well, from the beginning.

I will not go into more detail about what these concepts are precisely at this time, as they can easily googled (here you go); but as I post more tutorials it will be easier to help explain them with examples.

flex logo

Feel free to comment with some of your own ideas on what Flash and Flex are about. In the meantime I will start work on my first “actual” post about setting up Flash projects and linkages between flash library items (symbols) and actionscript classes that will define their behaviour. Hopefully I will get it up soon :)

Here are a couple of great Flash/Flex learning resources in the meantime:

take care everyone, and happy flashing/flexing haha,
~ anthony

p.s. I am still working on tweaking the design of this blog so please bear with me :)

1 Comment :, , more...