Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed #202

  • Loading branch information...
commit 9aee3c0a8aa6c4312b365427585ee8cf29953cb5 1 parent c0cdfa8
@keyemkey keyemkey authored
View
1  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 );
View
13 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");
View
7 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() );
}
}
View
5 awaybuilder-core/src/awaybuilder/view/components/PropertiesPanel.mxml
@@ -80,6 +80,9 @@
public var cubeTextures:ArrayCollection;
[Bindable]
+ public var texturePojectors:ArrayCollection;
+
+ [Bindable]
public var lightPickers:ArrayCollection;
public function showEditor( value:String, showNext:Boolean, showPrev:Boolean, data:Object ):void
@@ -125,7 +128,7 @@
<editors:LightPickerPropertiesEditor prevSelected="{prevSelected}" data="{data}" includeIn="lightPicker,initAll" />
<editors:ContainerPropertiesEditor prevSelected="{prevSelected}" data="{data}" includeIn="container,initAll" />
<editors:ShadowMethodPropertyEditor prevSelected="{prevSelected}" data="{data}" includeIn="shadowMethod,initAll" />
- <editors:EffectMethodPropertyEditor textures="{defaultableTextures}" cubeTextures="{cubeTextures}" prevSelected="{prevSelected}" data="{data}" includeIn="effectMethod,initAll" />
+ <editors:EffectMethodPropertyEditor textures="{defaultableTextures}" textureProjectors="{texturePojectors}" cubeTextures="{cubeTextures}" prevSelected="{prevSelected}" data="{data}" includeIn="effectMethod,initAll" />
<editors:ShadowMapperPropertyEditor prevSelected="{prevSelected}" data="{data}" includeIn="shadowMapper,initAll" />
<editors:ShadingPropertyEditor textures="{defaultableTextures}" cubeTextures="{cubeTextures}" prevSelected="{prevSelected}" data="{data}" includeIn="shadingMethod,initAll" />
<editors:GeometryPropertiesEditor prevSelected="{prevSelected}" data="{data}" includeIn="geometry,initAll" />
View
17 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 @@
>
<s:dataProvider>
<s:ArrayList>
- <fx:String>Add</fx:String>
- <fx:String>Multiply</fx:String>
- <fx:String>Mix</fx:String>
+ <fx:String>add</fx:String>
+ <fx:String>multiply</fx:String>
+ <fx:String>mix</fx:String>
</s:ArrayList>
</s:dataProvider>
</s:DropDownList>
@@ -176,10 +179,10 @@
<s:Label text="Texture Projector:" fontWeight="bold"/>
<controls:HorizontalFormSeparator/>
</s:HGroup>
- <!--<s:DropDownList id="textureProjectorDropDownList" requireSelection="true" selectionColor="0x111111"
- change="" width="100%"
- >
- </s:DropDownList>-->
+ <s:DropDownList id="textureProjectorDropDownList" requireSelection="true" selectionColor="0x111111"
+ change="value_changeHandler(event)" width="100%" selectedItem="@{_asset.textureProjector}"
+ dataProvider="{textureProjectors}">
+ </s:DropDownList>
</s:VGroup>
<s:VGroup width="100%" paddingLeft="10" includeIn="ColorMatrixMethod">
View
3  awaybuilder-core/src/awaybuilder/view/components/editors/MaterialPropertiesEditor.mxml
@@ -35,8 +35,7 @@
<fx:Object label="SimpleWaterNormalMethod" value="SimpleWaterNormalMethod"/>
</s:ArrayCollection>
<fx:Component className="NewEffectPopup">
- <s:SkinnablePopUpContainer skinClass="awaybuilder.view.skins.LibrarySkinnablePopUpContainer" chromeColor="0x1d1d1c" color="0xdbdbdb"
- mouseDownOutside="close();">
+ <s:SkinnablePopUpContainer skinClass="awaybuilder.view.skins.LibrarySkinnablePopUpContainer" chromeColor="0x1d1d1c" color="0xdbdbdb" mouseDownOutside="close();">
<s:Button width="100%" label="New LightMapMethod" styleName="addItemButton" cornerRadius="0" click="close(true,'LightMapMethod')"/>
<s:Button width="100%" label="New ProjectiveTextureMethod" styleName="addItemButton" cornerRadius="0" click="close(true,'ProjectiveTextureMethod')"/>
<s:Button width="100%" label="New RimLightMethod" styleName="addItemButton" cornerRadius="0" click="close(true,'RimLightMethod')"/>
View
20 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.<AssetVO> = 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.<AssetVO> = 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 );
Please sign in to comment.
Something went wrong with that request. Please try again.