the autodetection and plugin system it's really awesome. it really
could be the best loading and asset-management implementation i've
ever seen ^_^
as for the questions ...
the new async nature means that we will needto wait for the model to
completely load before adding it to the scene or use it, right?
we're goind to receive a general "complete" event from the
AssetLibrary for everything we load or we will get some kind of
reference from the AssetLibrary.load method, to add specific listeners
to it? in the former case, how can we distinguish between multiple
assets that could be loaded at the same time?
in the end i don't really understand the getAsset("meshName") method:
if we load a big model with a lot of meshes inside, we can retrieve a
singular mesh contained there, without the need of adding the whole
"world" to our scene?
we can also reference directly textures or other kind of assets?
Bianco Alessandro
2011/5/6 richardolsson <[email protected]>:
> Cheers guys!
>
> The document mainly outlines the changes between Away 3.x and this new
> solution, so not so much the transition from ResourceManager (the
> previous alpha solution that this one replaces) to AssetLibrary.
>
> However, the ResourceManager really didn't do much before, so I don't
> think that modifying your code for the AssetLibrary will require much
> work once the general understanding is there (and that's what I'm
> trying to provide through the document.) I know this from having
> changed all the examples very quickly from ResourceManager to Loader3D
> (which in essence is very similar to the AssetLibrary.)
>
> Since it's not in the document, let me quickly outline the reason for
> ditching the ResourceManager. With the ResourceManager we tried to do
> some pretty magical things with returning proxy objects for
> everything, and using the same method to load and retrieve an already
> loaded resource. As we were implementing more complex file formats
> (especially AWD and COLLADA) it became clear that this will not work
> throughout, so we decided to ditch it in favor of a single approach
> which would always work (first load, and retrieve from library only
> once loaded.)
>
> To clearly mark that we were moving away from the ResourceManager (and
> the fact that we now have a library-like functionality) we decided to
> rename the new manager class AssetLibrary, which is what you'll be
> working with from now on.
>
> Another important change is something that is indeed mentioned in the
> document, but deserves another mention, because IT'S VERY IMPORTANT!
> Away4 right now adds about 40kb to your SWF file, which is really
> neat. However, with the ResourceManager, all the parsers were
> forcefully included in the app adding almost 100kb. That's 200% extra
> weight for parsers that you may or may not use! We decided to remove
> the hard-coded parsers in favor of a plug-in approach, which is really
> nice for file size (and to some extent file format detection
> performance) but it does require you to do the following at an early
> point in your app, e.g. if you want to use AWD and OBJ files:
>
> AssetLibrary.enableParser(AWDParser);
> AssetLibrary.enableParser(OBJParser);
>
> If you don't care about file size, and just don't want to think about
> what file formats you'll be using, you can use a short-hand to add all
> the bundled parsers, which is essentially what happened automatically
> in the ResourceManager:
>
> AssetLibrary.enableParsers(Parsers.ALL_BUNDLED);
>
> One of the above needs to happen before the first load in your app is
> started.
>
> You can use the enableParser() set of methods on AssetLibrary,
> AssetLoader, Loader3D or SingleFileLoader (internal class) and they
> will all end up in the same place, so if you add the above line of
> code once in your app, you can then use automatic file detection in
> any or all of the AssetLibrary, AssetLoader and Loader3D.
>
>
> I was expecting more questions to be honest, so please don't be shy if
> you are wondering anything. :)
>
>
> Cheers
> /R
>
> On May 6, 8:59 am, Apprentice <[email protected]> wrote:
>> Thanks for letting us know :)
>> And for putting a document online which describes the changes in depth
>> (which I have yet to read carefully).
>>
>> On 5 mei, 20:01, Richard Olsson <[email protected]> wrote:
>>
>>
>>
>>
>>
>>
>>
>> > Hello Away3D community!
>>
>> > This is a heads up that in a moment, I will be pushing changes to the
>> > GitHub repository (SVN will follow in the next couple of days) that will
>> > likely break any code that you have that uses Broomstick (Away3D 4.0
>> > alpha). This is because of some major incompatible changes that we're
>> > making to the way that assets are loaded and managed in Away3D 4.0. (In
>> > the unlikely event that your code doesn't load assets at all, it might be
>> > unaffected.)
>>
>> > We wanted to make these changes right now, while Away3D is still in alpha,
>> > and we believe strongly that this is the best loading framework that we
>> > have ever had in Away3D (and probably better than most if not all
>> > competing engines out there.)
>>
>> > The short version is that we have removed the ResourceManager (which you
>> > are probably currently using to load assets) and replaced it with three
>> > different classes that can be used for loading: The AssetLibrary (with
>> > asset management features), the AssetLoader (for simple loading of files
>> > including dependencies) and the Loader3D (for easily loading assets into a
>> > scene.)
>>
>> > For those interested in a slightly longer description of the new loading
>> > framework, I have attached a five page PDF outlining the design
>> > principles, features and basic usage of the new loading classes. We hope
>> > this will ease your transition while waiting for proper documentation.
>>
>> > Remember that Away3D 4 is still alpha, and things might still change, but
>> > we feel a lot more comfortable with the new solution, and I think that we
>> > will be able to keep it more or less stable through to the final release
>> > of Away3D 4.0.
>>
>> > The examples have been updated as well (all apart from the ones that use
>> > MD5, so those are still broken. Please bear with us while we fix them.)
>> > Example code for the AssetLibrary, AssetLoader and Loader3D will be coming
>> > shortly as well.
>>
>> > Thanks for your understanding, and if you have any questions, comments,
>> > feature requests or bug reports: Fire away! ;)
>>
>> > /Richard, Away3D
>>
>> > LoadingInAway4.pdf
>> > 147KWeergevenDownloaden