diff --git a/awaybuilder-core/src/awaybuilder/controller/scene/AddNewEffectMethodCommand.as b/awaybuilder-core/src/awaybuilder/controller/scene/AddNewEffectMethodCommand.as
index 5f7eaca..5086d67 100644
--- a/awaybuilder-core/src/awaybuilder/controller/scene/AddNewEffectMethodCommand.as
+++ b/awaybuilder-core/src/awaybuilder/controller/scene/AddNewEffectMethodCommand.as
@@ -42,6 +42,7 @@ package awaybuilder.controller.scene
{
material.effectMethods.addItem(newValue);
}
+ material.fillFromMaterial( material );
}
commitHistoryEvent( event );
diff --git a/awaybuilder-core/src/awaybuilder/model/AssetsModel.as b/awaybuilder-core/src/awaybuilder/model/AssetsModel.as
index c541e3a..44e372d 100644
--- a/awaybuilder-core/src/awaybuilder/model/AssetsModel.as
+++ b/awaybuilder-core/src/awaybuilder/model/AssetsModel.as
@@ -55,6 +55,7 @@ package awaybuilder.model
import away3d.materials.methods.NearShadowMapMethod;
import away3d.materials.methods.OutlineMethod;
import away3d.materials.methods.PhongSpecularMethod;
+ import away3d.materials.methods.ProjectiveTextureMethod;
import away3d.materials.methods.RefractionEnvMapMethod;
import away3d.materials.methods.RimLightMethod;
import away3d.materials.methods.ShadingMethodBase;
@@ -246,7 +247,13 @@ package awaybuilder.model
camera.x = camera.y = camera.z = 0;
return GetAsset(camera) as CameraVO;
}
-
+ public function CreateProjectiveTextureMethod( textureProjector:TextureProjectorVO ):EffectMethodVO
+ {
+ var method:EffectMethodBase = new ProjectiveTextureMethod( GetObject(textureProjector) as TextureProjector );
+ method.name = "ProjectiveTexture " + AssetUtil.GetNextId("ProjectiveTexture");
+
+ return GetAsset( method ) as EffectMethodVO;
+ }
public function CreateEffectMethod( type:String ):EffectMethodVO
{
var method:EffectMethodBase;
@@ -256,10 +263,6 @@ package awaybuilder.model
method = new LightMapMethod(GetObject(defaultTexture) as Texture2DBase);
method.name = "LightMap" + AssetUtil.GetNextId("LightMapMethod");
break;
- case "ProjectiveTextureMethod":
-// method = new ProjectiveTextureMethod();
-// method.name = "ProjectiveTexture " + AssetUtil.GetNextId("ProjectiveTexture");
- break;
case "RimLightMethod":
method = new RimLightMethod();
method.name = "RimLight" + AssetUtil.GetNextId("RimLightMethod");
diff --git a/awaybuilder-core/src/awaybuilder/model/vo/scene/MaterialVO.as b/awaybuilder-core/src/awaybuilder/model/vo/scene/MaterialVO.as
index 30d6a32..2566d14 100644
--- a/awaybuilder-core/src/awaybuilder/model/vo/scene/MaterialVO.as
+++ b/awaybuilder-core/src/awaybuilder/model/vo/scene/MaterialVO.as
@@ -118,12 +118,7 @@ package awaybuilder.model.vo.scene
this.specularTexture = asset.specularTexture;
this.specularMethod = asset.specularMethod;
- var effects:Array = [];
- for each( var effect:EffectMethodVO in asset.effectMethods )
- {
- effects.push( effect );
- }
- this.effectMethods = new ArrayCollection( effects );
+ this.effectMethods = new ArrayCollection( asset.effectMethods.source.concat() );
}
}
diff --git a/awaybuilder-core/src/awaybuilder/view/components/PropertiesPanel.mxml b/awaybuilder-core/src/awaybuilder/view/components/PropertiesPanel.mxml
index 7548ce5..e691b1f 100644
--- a/awaybuilder-core/src/awaybuilder/view/components/PropertiesPanel.mxml
+++ b/awaybuilder-core/src/awaybuilder/view/components/PropertiesPanel.mxml
@@ -79,6 +79,9 @@
[Bindable]
public var cubeTextures:ArrayCollection;
+ [Bindable]
+ public var texturePojectors:ArrayCollection;
+
[Bindable]
public var lightPickers:ArrayCollection;
@@ -125,7 +128,7 @@
-
+
diff --git a/awaybuilder-core/src/awaybuilder/view/components/editors/EffectMethodPropertyEditor.mxml b/awaybuilder-core/src/awaybuilder/view/components/editors/EffectMethodPropertyEditor.mxml
index 9446632..8b8f86b 100644
--- a/awaybuilder-core/src/awaybuilder/view/components/editors/EffectMethodPropertyEditor.mxml
+++ b/awaybuilder-core/src/awaybuilder/view/components/editors/EffectMethodPropertyEditor.mxml
@@ -30,6 +30,7 @@
import awaybuilder.view.components.controls.events.ExtendedDropDownEvent;
import awaybuilder.view.components.editors.events.PropertyEditorEvent;
+ import mx.collections.ArrayCollection;
import mx.events.ColorPickerEvent;
import spark.events.IndexChangeEvent;
@@ -42,6 +43,8 @@
[Bindable] private var _selectedTexture:TextureVO;
+ [Bindable] public var textureProjectors:ArrayCollection;
+
override protected function validate():void
{
if( !(data is EffectMethodVO) ) return;
@@ -166,9 +169,9 @@
>
- Add
- Multiply
- Mix
+ add
+ multiply
+ mix
@@ -176,10 +179,10 @@
-
+
+
diff --git a/awaybuilder-core/src/awaybuilder/view/components/editors/MaterialPropertiesEditor.mxml b/awaybuilder-core/src/awaybuilder/view/components/editors/MaterialPropertiesEditor.mxml
index fbe3ec1..52470bc 100644
--- a/awaybuilder-core/src/awaybuilder/view/components/editors/MaterialPropertiesEditor.mxml
+++ b/awaybuilder-core/src/awaybuilder/view/components/editors/MaterialPropertiesEditor.mxml
@@ -35,8 +35,7 @@
-
+
diff --git a/awaybuilder-core/src/awaybuilder/view/mediators/PropertiesPanelMediator.as b/awaybuilder-core/src/awaybuilder/view/mediators/PropertiesPanelMediator.as
index dd702cb..283632e 100644
--- a/awaybuilder-core/src/awaybuilder/view/mediators/PropertiesPanelMediator.as
+++ b/awaybuilder-core/src/awaybuilder/view/mediators/PropertiesPanelMediator.as
@@ -37,6 +37,7 @@ package awaybuilder.view.mediators
import flash.events.Event;
import flash.geom.Vector3D;
+ import mx.charts.AreaChart;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.CloseEvent;
@@ -500,11 +501,18 @@ package awaybuilder.view.mediators
{
if( event.data == "ProjectiveTextureMethod" )
{
- Alert.show( "TextureProjector is missing", "Warning" );
+ var textureProjectors:Vector. = document.getAssetsByType( TextureProjectorVO );
+ if( textureProjectors.length == 0 )
+ {
+ Alert.show( "TextureProjector is missing", "Warning" );
+ }
+ else
+ {
+ this.dispatch(new SceneEvent(SceneEvent.ADD_NEW_EFFECT_METHOD,[view.data], assets.CreateProjectiveTextureMethod( textureProjectors[0] as TextureProjectorVO )));
+ }
return;
}
this.dispatch(new SceneEvent(SceneEvent.ADD_NEW_EFFECT_METHOD,[view.data], assets.CreateEffectMethod( event.data as String )));
-
}
private function view_materialRemoveEffectMetodHandler(event:PropertyEditorEvent):void
{
@@ -878,6 +886,14 @@ package awaybuilder.view.mediators
view.animators = new ArrayCollection(animators);
view.skeletons = new ArrayCollection(skeletons);
+ var texturePojectors:Array = [];
+ var texturePojectorsVector:Vector. = document.getAssetsByType( TextureProjectorVO );
+ for each( asset in texturePojectorsVector )
+ {
+ texturePojectors.push( asset );
+ }
+ view.texturePojectors = new ArrayCollection( texturePojectors );
+
var materials:ArrayCollection = new ArrayCollection();
materials.addAll( document.materials );
materials.addItemAt( assets.defaultMaterial, 0 );