読者です 読者をやめる 読者になる 読者になる

Away3D-v2.2でMetasequoia形式(MQO)を読み込む

ActionScript3.0 Metasequoia ColladaView Away3D

Sleepy Designの方にあったAway3D対応Metasequoiaクラスがv2.2で動かなかったので直したり。


とりあえずWinMergeで吐いたパッチ

28,29c28,30
< package away3d.loaders {
< 	
    • -
> package away3d.loaders > { > import away3d.containers.ObjectContainer3D; 33a35 > import away3d.loaders.utils.MaterialLibrary; 36a39 > import away3d.loaders.*; 42c45,48 < public class Metasequoia {
    • -
> public class Metasequoia extends AbstractParser { > use namespace arcane; > /** @private */ > arcane var ini:Init; 49c55,56 < private var materials:Dictionary;
    • -
> //private var materials:Dictionary; > public var materialLibrary:MaterialLibrary; 53a61,63 > container = new ObjectContainer3D(ini); > container.name = "Metasequoia"; > 59c69 <
    • -
> 60a71,76 > > container = mesh; > } > public override function parseNext():void > { > notifySuccess(); 62d77 < 65a81 > //return Object3DLoader.parseGeometry(data, Metasequoia, init).handle as ObjectContainer3D; 67d82 < 70c85 < return Object3DLoader.loadGeometry(url, parse, true, init);
    • -
> return Object3DLoader.loadGeometry(url, Metasequoia, true, init); 84,85c99,100 < _prevDepth = 0; < _prevMesh = this;
    • -
> //_prevDepth = 0; > //_prevMesh = this; 105c120,121 < materials = new Dictionary();
    • -
> //materials = new Dictionary(); > materialLibrary = new MaterialLibrary(); 153c169 < _material = ITriangleMaterial.DEFAULT;
    • -
> //_material = ITriangleMaterial.DEFAULT; 157c173,174 < materials[name] = _material;
    • -
> //materials[name] = _material; > materialLibrary[name] = _material; 281c298,299 < _material = materials[_materialNames[parseInt(mstr)]];
    • -
> //_material = materials[_materialNames[parseInt(mstr)]]; > _material = materialLibrary[_materialNames[parseInt(mstr)]]; 312c330,331 < _material = materials[_materialNames[parseInt(mstr)]];
    • -
> //_material = materials[_materialNames[parseInt(mstr)]]; > _material = materialLibrary[_materialNames[parseInt(mstr)]];