├── .gitignore ├── Map ├── IScale3D.cs ├── ILocation.cs ├── IMobility.cs ├── IRotation.cs ├── Level.cs ├── Map.cs ├── BaseComponentProcessor.cs ├── SkyLight.cs ├── ExponentialHeightFog.cs ├── DecalActor.cs ├── DecalComponent.cs ├── StaticMeshActor.cs ├── SkeletalMeshActor.cs ├── DirectionalLightActor.cs ├── MapDocumentProcessor.cs ├── BaseActorNodeProcessor.cs ├── PointLightActor.cs ├── SphereReflectionCaptureActor.cs ├── SpotLightActor.cs ├── SkeletalMeshComponent.cs ├── StaticMeshComponent.cs ├── SphereReflectionCaptureComponent.cs ├── DirectionalLightComponent.cs ├── PointLightComponent.cs ├── SpotLightComponent.cs └── ExponentialHeightFogComponent.cs ├── Mobility.cs ├── IEditorPositionable.cs ├── ReflectionSourceType.cs ├── BlendMode.cs ├── Exception ├── T3DException.cs ├── ValueException.cs └── ParserException.cs ├── MaterialDomain.cs ├── SpawnCollisionHandlingMethod.cs ├── Vector3.cs ├── FunctionReference.cs ├── ResourceReference.cs ├── TranslucencyLightingMode.cs ├── Processor ├── GenericDocumentProcessor.cs ├── Problem.cs ├── PropertyDefinition.cs ├── PropertyDataType.cs └── NodeProcessor.cs ├── ExpressionReference.cs ├── Rotator.cs ├── Parser ├── ParsedNodeBag.cs ├── ParsedDocument.cs ├── ParsedProperty.cs ├── ParsedPropertyBag.cs └── ParsedNode.cs ├── ShadingModel.cs ├── Vector4.cs ├── SamplerType.cs ├── Common └── ObjectNodeProcessor.cs ├── Material ├── VectorConstantNode.cs ├── MaterialExpressionParticleSize.cs ├── MaterialExpressionParticleColor.cs ├── MaterialExpressionTime.cs ├── MaterialExpressionScreenPosition.cs ├── MaterialExpressionVertexNormalWS.cs ├── ParameterNode.cs ├── MaterialExpressionCameraPositionWS.cs ├── MaterialExpressionPixelDepth.cs ├── MaterialNode.cs ├── MaterialExpressionConstant3Vector.cs ├── MaterialExpressionVertexColor.cs ├── MaterialExpressionConstant4Vector.cs ├── MaterialExpressionDDX.cs ├── MaterialExpressionDDY.cs ├── MaterialExpressionFrac.cs ├── MaterialExpressionFloor.cs ├── MaterialExpressionConstant.cs ├── MaterialExpressionOneMinus.cs ├── MaterialExpressionAbs.cs ├── MaterialExpressionNormalize.cs ├── MaterialExpressionConstant2Vector.cs ├── MaterialExpressionDistance.cs ├── MaterialExpressionSine.cs ├── MaterialExpressionWorldPosition.cs ├── MaterialExpressionDotProduct.cs ├── MaterialExpressionAppendVector.cs ├── MaterialExpressionCrossProduct.cs ├── MaterialExpressionVectorParameter.cs ├── MaterialExpressionStaticBoolParameter.cs ├── MaterialExpressionTextureObject.cs ├── MaterialExpressionComment.cs ├── MaterialExpressionScalarParameter.cs ├── MaterialExpressionDesaturation.cs ├── MaterialExpressionSceneDepth.cs ├── MaterialExpressionTextureObjectParameter.cs ├── MaterialExpressionSceneTexture.cs ├── MaterialExpressionDivide.cs ├── MaterialExpressionSubtract.cs ├── MaterialExpressionTransform.cs ├── MaterialExpressionPower.cs ├── MaterialExpressionStaticSwitch.cs ├── MaterialExpressionTextureCoordinate.cs ├── MaterialExpressionStaticSwitchParameter.cs ├── MaterialExpressionComponentMask.cs ├── MaterialExpressionAdd.cs ├── MaterialExpressionMaterialFunctionCall.cs ├── MaterialExpressionDepthFade.cs ├── MaterialExpressionMultiply.cs ├── MaterialExpressionTextureSample.cs ├── MaterialExpressionClamp.cs ├── MaterialExpressionTextureSampleParameter2D.cs ├── MaterialExpressionRotateAboutAxis.cs ├── MaterialExpressionFresnel.cs ├── MaterialExpressionPanner.cs ├── MaterialExpressionLinearInterpolate.cs └── MaterialDocumentProcessor.cs ├── MaterialInstance ├── MaterialInstanceDocumentProcessor.cs └── MaterialInstance.cs ├── Node.cs ├── LICENSE ├── Properties └── AssemblyInfo.cs ├── .editorconfig ├── Common.cs └── JollySamurai.UnrealEngine4.T3D.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vs 3 | bin 4 | obj 5 | -------------------------------------------------------------------------------- /Map/IScale3D.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Map 2 | { 3 | public interface IScale3D 4 | { 5 | Vector3 Scale3D { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Map/ILocation.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Map 2 | { 3 | public interface ILocation 4 | { 5 | Vector3 Location { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Map/IMobility.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Map 2 | { 3 | public interface IMobility 4 | { 5 | Mobility Mobility { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Map/IRotation.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Map 2 | { 3 | public interface IRotation 4 | { 5 | Rotator Rotation { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Mobility.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum Mobility 4 | { 5 | Movable, 6 | Static, 7 | Stationary, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IEditorPositionable.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public interface IEditorPositionable 4 | { 5 | int EditorX { get; } 6 | int EditorY { get; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ReflectionSourceType.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum ReflectionSourceType 4 | { 5 | Unknown, 6 | CapturedScene, 7 | SpecifiedCubemap, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /BlendMode.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum BlendMode 4 | { 5 | Additive, 6 | Masked, 7 | Modulate, 8 | Opaque, 9 | Translucent, 10 | Unknown 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Exception/T3DException.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Exception 2 | { 3 | public class T3DException : System.Exception 4 | { 5 | public T3DException(string message) 6 | : base(message) 7 | { 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Exception/ValueException.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Exception 2 | { 3 | public class ValueException : T3DException 4 | { 5 | public ValueException(string message) 6 | : base(message) 7 | { 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MaterialDomain.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Material 2 | { 3 | public enum MaterialDomain 4 | { 5 | Unknown, 6 | Surface, 7 | DeferredDecal, 8 | LightFunction, 9 | Volume, 10 | PostProcess, 11 | Ui, 12 | RuntimeVirtualTexture, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SpawnCollisionHandlingMethod.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum SpawnCollisionHandlingMethod 4 | { 5 | Unknown, 6 | AlwaysSpawn, 7 | AdjustIfPossibleButAlwaysSpawn, 8 | AdjustIfPossibleButDontSpawnIfColliding, 9 | DontSpawnIfColliding 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Vector3.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public struct Vector3 4 | { 5 | public float X { get; } 6 | public float Y { get; } 7 | public float Z { get; } 8 | 9 | public Vector3(float x, float y, float z) 10 | { 11 | X = x; 12 | Y = y; 13 | Z = z; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /FunctionReference.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public class FunctionReference 4 | { 5 | public string Type { get; } 6 | public string Name { get; } 7 | 8 | public FunctionReference(string type, string name) 9 | { 10 | Type = type; 11 | Name = name; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ResourceReference.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public class ResourceReference 4 | { 5 | public string Type { get; } 6 | public string FileName { get; } 7 | 8 | public ResourceReference(string type, string fileName) 9 | { 10 | Type = type; 11 | FileName = fileName; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TranslucencyLightingMode.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum TranslucencyLightingMode 4 | { 5 | Unknown, 6 | VolumetricNonDirectional, 7 | VolumetricDirectional, 8 | VolumetricPerVertexNonDirectional, 9 | VolumetricPerVertexDirectional, 10 | Surface, 11 | SurfacePerPixelLighting, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Processor/GenericDocumentProcessor.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Processor 4 | { 5 | public class GenericDocumentProcessor : DocumentProcessor 6 | where T : Node 7 | { 8 | protected override bool IsIgnoredNode(ParsedNode parsedNode) 9 | { 10 | return false; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ExpressionReference.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public class ExpressionReference 4 | { 5 | public string ClassName { get; } 6 | public string NodeName { get; } 7 | 8 | public ExpressionReference(string className, string nodeName) 9 | { 10 | ClassName = className; 11 | NodeName = nodeName; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Rotator.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public struct Rotator 4 | { 5 | public float Pitch { get; } 6 | public float Yaw { get; } 7 | public float Roll { get; } 8 | 9 | public Rotator(float pitch, float yaw, float roll) 10 | { 11 | Pitch = pitch; 12 | Yaw = yaw; 13 | Roll = roll; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Parser/ParsedNodeBag.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Parser 2 | { 3 | public class ParsedNodeBag 4 | { 5 | public ParsedNode[] Nodes { get; } 6 | 7 | public ParsedNodeBag(ParsedNode[] nodes) 8 | { 9 | Nodes = nodes; 10 | } 11 | 12 | public static ParsedNodeBag Empty => 13 | new ParsedNodeBag(new ParsedNode[] { 14 | }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Exception/ParserException.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Exception 2 | { 3 | public class ParserException : T3DException 4 | { 5 | public int Line { get; } 6 | public int Column { get; } 7 | 8 | public ParserException(string message, int line, int column) 9 | : base(message) 10 | { 11 | Line = line; 12 | Column = column; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ShadingModel.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum ShadingModel 4 | { 5 | Unknown, 6 | Unlit, 7 | DefaultLit, 8 | Subsurface, 9 | PreIntegratedSkin, 10 | ClearCoat, 11 | SubsurfaceProfile, 12 | TwoSidedFoliage, 13 | Hair, 14 | Cloth, 15 | Eye, 16 | SingleLayerWater, 17 | ThinTranslucent 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Vector4.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public struct Vector4 4 | { 5 | public float X { get; } 6 | public float Y { get; } 7 | public float Z { get; } 8 | public float A { get; } 9 | 10 | public Vector4(float x, float y, float z, float a) 11 | { 12 | X = x; 13 | Y = y; 14 | Z = z; 15 | A = a; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Processor/Problem.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Processor 2 | { 3 | public class Problem 4 | { 5 | public ProblemSeverity Severity { get; } 6 | public string Message { get; } 7 | 8 | public Problem(ProblemSeverity severity, string message) 9 | { 10 | Severity = severity; 11 | Message = message; 12 | } 13 | } 14 | 15 | public enum ProblemSeverity 16 | { 17 | Error, 18 | Warning 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SamplerType.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum SamplerType 4 | { 5 | Unknown, 6 | Default, 7 | Color, 8 | Grayscale, 9 | Alpha, 10 | Normal, 11 | Masks, 12 | DistanceFieldFont, 13 | LinearColor, 14 | LinearGrayscale, 15 | Data, 16 | External, 17 | VirtualColor, 18 | VirtualGrayscale, 19 | VirtualAlpha, 20 | VirtualNormal, 21 | VirtualMasks, 22 | VirtualLinearColor, 23 | VirtualLinearGrayscale, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Processor/PropertyDefinition.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Processor 2 | { 3 | public class PropertyDefinition 4 | { 5 | public string Name { get; } 6 | public PropertyDataType DataType { get; } 7 | public bool IsRequired { get; } 8 | 9 | public bool IsArray => DataType.HasFlag(PropertyDataType.Array); 10 | 11 | public PropertyDefinition(string name, PropertyDataType dataType, bool isRequired) 12 | { 13 | Name = name; 14 | DataType = dataType; 15 | IsRequired = isRequired; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Parser/ParsedDocument.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Parser 2 | { 3 | public class ParsedDocument 4 | { 5 | public ParsedNode RootNode { get; } 6 | public string FileName { get; } 7 | 8 | public ParsedDocument(string fileName, ParsedNode rootNode) 9 | { 10 | FileName = fileName; 11 | RootNode = rootNode; 12 | } 13 | 14 | public static ParsedDocument From(string fileName, string content) 15 | { 16 | DocumentParser documentParser = new DocumentParser(content); 17 | ParsedNode rootNode = documentParser.Parse(); 18 | 19 | return new ParsedDocument(fileName, rootNode); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Common/ObjectNodeProcessor.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Common 5 | { 6 | public abstract class ObjectNodeProcessor : NodeProcessor 7 | { 8 | public abstract string Class { get; } 9 | 10 | public ObjectNodeProcessor() 11 | { 12 | AddRequiredAttribute("Name", PropertyDataType.String); 13 | 14 | AddIgnoredAttribute("Class"); 15 | } 16 | 17 | public override bool Supports(ParsedNode node) 18 | { 19 | return node.SectionType == "Object" && this.Class == node.AttributeBag.FindProperty("Class")?.Value; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Material/VectorConstantNode.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Processor; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public abstract class VectorConstantNode : MaterialNode 6 | { 7 | public Vector4 Constant { get; } 8 | 9 | public VectorConstantNode(string name, int editorX, int editorY, Vector4 constant) 10 | : base(name, editorX, editorY) 11 | { 12 | Constant = constant; 13 | } 14 | } 15 | 16 | public abstract class VectorConstantProcessor : MaterialNodeProcessor 17 | { 18 | public VectorConstantProcessor() 19 | { 20 | AddOptionalProperty("Constant", PropertyDataType.Vector4); 21 | 22 | AddIgnoredProperty("bCollapsed"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Map/Level.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class Level : Node 7 | { 8 | public Level(string name, Node[] children) 9 | : base(name, children) 10 | { 11 | } 12 | } 13 | 14 | public class LevelProcessor : NodeProcessor 15 | { 16 | public LevelProcessor() 17 | : base() 18 | { 19 | AddRequiredAttribute("NAME", PropertyDataType.String); 20 | } 21 | 22 | public override bool Supports(ParsedNode node) 23 | { 24 | return node.SectionType == "Level"; 25 | } 26 | 27 | public override Node Convert(ParsedNode node, Node[] children) 28 | { 29 | return new Level(node.FindAttributeValue("NAME"), children); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /MaterialInstance/MaterialInstanceDocumentProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.MaterialInstance 6 | { 7 | public class MaterialInstanceDocumentProcessor : DocumentProcessor 8 | { 9 | private readonly string[] IgnoredNodes = { 10 | "/Script/UnrealEd.SceneThumbnailInfoWithPrimitive", 11 | }; 12 | 13 | public MaterialInstanceDocumentProcessor() 14 | { 15 | AddNodeProcessor(new MaterialInstanceProcessor()); 16 | } 17 | 18 | protected override bool IsIgnoredNode(ParsedNode parsedNode) 19 | { 20 | var nodeClass = parsedNode.AttributeBag.FindProperty("Class")?.Value; 21 | 22 | return IgnoredNodes.Count(s => s == nodeClass) != 0; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Node.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public abstract class Node 4 | { 5 | public string Name { get; } 6 | 7 | public Node[] Children { get; } 8 | 9 | public Node(string name, Node[] children = null) 10 | { 11 | Name = name; 12 | Children = children; 13 | } 14 | 15 | public bool IsClassOf(string className) 16 | { 17 | return GetType().Name == className; 18 | } 19 | 20 | public Node FindChildByName(string name) 21 | { 22 | if (Children == null || string.IsNullOrEmpty(name)) { 23 | return null; 24 | } 25 | 26 | foreach (var child in Children) { 27 | if (child.Name == name) { 28 | return child; 29 | } 30 | } 31 | 32 | return null; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Material/MaterialExpressionParticleSize.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public class MaterialExpressionParticleSize : MaterialNode 6 | { 7 | public MaterialExpressionParticleSize(string name, int editorX, int editorY) 8 | : base(name, editorX, editorY) 9 | { 10 | } 11 | } 12 | 13 | public class MaterialExpressionParticleSizeProcessor : MaterialNodeProcessor 14 | { 15 | public override string Class => "/Script/Engine.MaterialExpressionParticleSize"; 16 | 17 | public override Node Convert(ParsedNode node, Node[] children) 18 | { 19 | return new MaterialExpressionParticleSize( 20 | node.FindAttributeValue("Name"), 21 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 23 | ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Material/MaterialExpressionParticleColor.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public class MaterialExpressionParticleColor : MaterialNode 6 | { 7 | public MaterialExpressionParticleColor(string name, int editorX, int editorY) 8 | : base(name, editorX, editorY) 9 | { 10 | } 11 | } 12 | 13 | public class MaterialExpressionParticleColorProcessor : MaterialNodeProcessor 14 | { 15 | public override string Class => "/Script/Engine.MaterialExpressionParticleColor"; 16 | 17 | public override Node Convert(ParsedNode node, Node[] children) 18 | { 19 | return new MaterialExpressionParticleColor( 20 | node.FindAttributeValue("Name"), 21 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 23 | ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Material/MaterialExpressionTime.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionTime : MaterialNode 7 | { 8 | public MaterialExpressionTime(string name, int editorX, int editorY) 9 | : base(name, editorX, editorY) 10 | { 11 | } 12 | } 13 | 14 | public class MaterialExpressionTimeProcessor : MaterialNodeProcessor 15 | { 16 | public override string Class => "/Script/Engine.MaterialExpressionTime"; 17 | 18 | public override Node Convert(ParsedNode node, Node[] children) 19 | { 20 | return new MaterialExpressionTime( 21 | node.FindAttributeValue("Name"), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 23 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 24 | ); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Material/MaterialExpressionScreenPosition.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public class MaterialExpressionScreenPosition : MaterialNode 6 | { 7 | public MaterialExpressionScreenPosition(string name, int editorX, int editorY) 8 | : base(name, editorX, editorY) 9 | { 10 | } 11 | } 12 | 13 | public class MaterialExpressionScreenPositionProcessor : MaterialNodeProcessor 14 | { 15 | public override string Class => "/Script/Engine.MaterialExpressionScreenPosition"; 16 | 17 | public override Node Convert(ParsedNode node, Node[] children) 18 | { 19 | return new MaterialExpressionScreenPosition( 20 | node.FindAttributeValue("Name"), 21 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 23 | ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Material/MaterialExpressionVertexNormalWS.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public class MaterialExpressionVertexNormalWS : MaterialNode 6 | { 7 | public MaterialExpressionVertexNormalWS(string name, int editorX, int editorY) 8 | : base(name, editorX, editorY) 9 | { 10 | } 11 | } 12 | 13 | public class MaterialExpressionVertexNormalWSProcessor : MaterialNodeProcessor 14 | { 15 | public override string Class => "/Script/Engine.MaterialExpressionVertexNormalWS"; 16 | 17 | public override Node Convert(ParsedNode node, Node[] children) 18 | { 19 | return new MaterialExpressionVertexNormalWS( 20 | node.FindAttributeValue("Name"), 21 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 23 | ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Material/ParameterNode.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D.Material 2 | { 3 | public abstract class ParameterNode : ParameterNode 4 | { 5 | public T DefaultValue { get; } 6 | 7 | public ParameterNode(string name, int editorX, int editorY, string parameterName, T defaultValue) 8 | : base(name, editorX, editorY, parameterName) 9 | { 10 | DefaultValue = defaultValue; 11 | } 12 | } 13 | 14 | public abstract class ParameterNode : MaterialNode 15 | { 16 | public string ParameterName { get; } 17 | 18 | public ParameterNode(string name, int editorX, int editorY, string parameterName) 19 | : base(name, editorX, editorY) 20 | { 21 | ParameterName = parameterName; 22 | } 23 | } 24 | 25 | public abstract class ParameterNodeProcessor : MaterialNodeProcessor 26 | { 27 | public ParameterNodeProcessor() 28 | { 29 | AddIgnoredProperty("SortPriority"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Map/Map.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class Map : Node 8 | { 9 | public int LevelCount => Children.Count(node => node is Level); 10 | public Level[] Levels => Children.OfType().ToArray(); 11 | 12 | public Map(string name, Node[] children) 13 | : base(name, children) 14 | { 15 | } 16 | } 17 | 18 | public class MapProcessor : NodeProcessor 19 | { 20 | public MapProcessor() 21 | { 22 | AddRequiredAttribute("Name", PropertyDataType.String); 23 | } 24 | 25 | public override bool Supports(ParsedNode node) 26 | { 27 | return node.SectionType == "Map"; 28 | } 29 | 30 | public override Node Convert(ParsedNode node, Node[] children) 31 | { 32 | return new Map(node.FindAttributeValue("Name"), children); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Material/MaterialExpressionCameraPositionWS.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public class MaterialExpressionCameraPositionWS : MaterialNode 6 | { 7 | public MaterialExpressionCameraPositionWS(string name, int editorX, int editorY) 8 | : base(name, editorX, editorY) 9 | { 10 | } 11 | } 12 | 13 | public class MaterialExpressionCameraPositionWSProcessor : MaterialNodeProcessor 14 | { 15 | public override string Class => "/Script/Engine.MaterialExpressionCameraPositionWS"; 16 | 17 | public override Node Convert(ParsedNode node, Node[] children) 18 | { 19 | return new MaterialExpressionCameraPositionWS( 20 | node.FindAttributeValue("Name"), 21 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 23 | ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Processor/PropertyDataType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Processor 4 | { 5 | [Flags] 6 | public enum PropertyDataType 7 | { 8 | Array = 1, 9 | BlendMode = 2, 10 | Boolean = 4, 11 | ExpressionReference = 8, 12 | Float = 16, 13 | FunctionReference = 32, 14 | Integer = 64, 15 | AttributeList = 128, 16 | SamplerType = 256, 17 | ShadingModel = 512, 18 | String = 1024, 19 | ResourceReference = 2048, 20 | Vector4 = 4096, 21 | MaterialDomain = 8192, 22 | TranslucencyLightingMode = 16384, 23 | Vector3 = 32768, 24 | Rotator = 65536, 25 | Mobility = 131072, 26 | Vector2 = 262144, 27 | DecalBlendMode = 524288, 28 | WorldPositionIncludedOffsets = 1048576, 29 | MaterialSceneAttributeInputMode = 2097152, 30 | SceneTextureId = 4194304, 31 | MaterialVectorCoordTransformSource = 8388608, 32 | MaterialVectorCoordTransform = 16777216 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Parser/ParsedProperty.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Parser 5 | { 6 | public class ParsedProperty 7 | { 8 | public static readonly Regex ArrayRegex = new Regex(@"(\w+)\(([0-9]+)\)", RegexOptions.Compiled); 9 | 10 | public string Name { get; } 11 | public string Value { get; } 12 | public ParsedProperty[] Elements { get; } 13 | public bool IsArray { get; } 14 | 15 | public ParsedProperty(string name, string value) 16 | { 17 | Trace.Assert(! string.IsNullOrEmpty(name)); 18 | 19 | Name = name; 20 | Value = value; 21 | IsArray = false; 22 | } 23 | 24 | public ParsedProperty(string name, ParsedProperty[] arrayElements) 25 | { 26 | Trace.Assert(! string.IsNullOrEmpty(name)); 27 | 28 | Name = name; 29 | IsArray = true; 30 | Elements = arrayElements; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Material/MaterialExpressionPixelDepth.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionPixelDepth : MaterialNode 7 | { 8 | public MaterialExpressionPixelDepth(string name, int editorX, int editorY) 9 | : base(name, editorX, editorY) 10 | { 11 | } 12 | } 13 | 14 | public class MaterialExpressionPixelDepthProcessor : MaterialNodeProcessor 15 | { 16 | public override string Class => "/Script/Engine.MaterialExpressionPixelDepth"; 17 | 18 | public override Node Convert(ParsedNode node, Node[] children) 19 | { 20 | return new MaterialExpressionPixelDepth( 21 | node.FindAttributeValue("Name"), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 23 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 24 | ); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Material/MaterialNode.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Common; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public abstract class MaterialNode : Node, IEditorPositionable 7 | { 8 | public int EditorX { get; } 9 | public int EditorY { get; } 10 | 11 | public MaterialNode(string name, int editorX, int editorY, Node[] children = null) 12 | : base(name, children) 13 | { 14 | EditorX = editorX; 15 | EditorY = editorY; 16 | } 17 | } 18 | 19 | public abstract class MaterialNodeProcessor : ObjectNodeProcessor 20 | { 21 | public MaterialNodeProcessor() 22 | { 23 | AddOptionalProperty("MaterialExpressionEditorX", PropertyDataType.Integer); 24 | AddOptionalProperty("MaterialExpressionEditorY", PropertyDataType.Integer); 25 | 26 | AddIgnoredProperty("Desc"); 27 | AddIgnoredProperty("MaterialExpressionGuid"); 28 | AddIgnoredProperty("Material"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Iain Mckay 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Material/MaterialExpressionConstant3Vector.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public class MaterialExpressionConstant3Vector : VectorConstantNode 6 | { 7 | public MaterialExpressionConstant3Vector(string name, int editorX, int editorY, Vector4 constant) 8 | : base(name, editorX, editorY, constant) 9 | { 10 | } 11 | } 12 | 13 | public class MaterialExpressionConstant3VectorProcessor : VectorConstantProcessor 14 | { 15 | public override string Class => "/Script/Engine.MaterialExpressionConstant3Vector"; 16 | 17 | public override Node Convert(ParsedNode node, Node[] children) 18 | { 19 | return new MaterialExpressionConstant3Vector( 20 | node.FindAttributeValue("Name"), 21 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 22 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 23 | ValueUtil.ParseVector4(node.FindPropertyValue("Constant")) 24 | ); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Material/MaterialExpressionVertexColor.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | 3 | namespace JollySamurai.UnrealEngine4.T3D.Material 4 | { 5 | public class MaterialExpressionVertexColor : MaterialNode 6 | { 7 | public MaterialExpressionVertexColor(string name, int editorX, int editorY) 8 | : base(name, editorX, editorY) 9 | { 10 | } 11 | } 12 | 13 | public class MaterialExpressionVertexColorProcessor : MaterialNodeProcessor 14 | { 15 | public override string Class => "/Script/Engine.MaterialExpressionVertexColor"; 16 | 17 | public MaterialExpressionVertexColorProcessor() 18 | { 19 | AddIgnoredProperty("bCollapsed"); 20 | } 21 | 22 | public override Node Convert(ParsedNode node, Node[] children) 23 | { 24 | return new MaterialExpressionVertexColor( 25 | node.FindAttributeValue("Name"), 26 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 27 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")) 28 | ); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Material/MaterialExpressionConstant4Vector.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionConstant4Vector : VectorConstantNode 7 | { 8 | public MaterialExpressionConstant4Vector(string name, int editorX, int editorY, Vector4 constant) 9 | : base(name, editorX, editorY, constant) 10 | { 11 | } 12 | } 13 | 14 | public class MaterialExpressionConstant4VectorProcessor : MaterialNodeProcessor 15 | { 16 | public override string Class => "/Script/Engine.MaterialExpressionConstant4Vector"; 17 | 18 | public MaterialExpressionConstant4VectorProcessor() 19 | { 20 | AddOptionalProperty("Constant", PropertyDataType.Vector4); 21 | } 22 | 23 | public override Node Convert(ParsedNode node, Node[] children) 24 | { 25 | return new MaterialExpressionConstant4Vector( 26 | node.FindAttributeValue("Name"), 27 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 28 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 29 | ValueUtil.ParseVector4(node.FindPropertyValue("Constant")) 30 | ); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Material/MaterialExpressionDDX.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionDDX : MaterialNode 7 | { 8 | public ParsedPropertyBag Value { get; } 9 | 10 | public MaterialExpressionDDX(string name, int editorX, int editorY, ParsedPropertyBag value) 11 | : base(name, editorX, editorY) 12 | { 13 | Value = value; 14 | } 15 | } 16 | 17 | public class MaterialExpressionDDXProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionDDX"; 20 | 21 | public MaterialExpressionDDXProcessor() 22 | { 23 | AddOptionalProperty("Value", PropertyDataType.AttributeList); 24 | } 25 | 26 | public override Node Convert(ParsedNode node, Node[] children) 27 | { 28 | return new MaterialExpressionDDX( 29 | node.FindAttributeValue("Name"), 30 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 32 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Value")) 33 | ); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Material/MaterialExpressionDDY.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionDDY : MaterialNode 7 | { 8 | public ParsedPropertyBag Value { get; } 9 | 10 | public MaterialExpressionDDY(string name, int editorX, int editorY, ParsedPropertyBag value) 11 | : base(name, editorX, editorY) 12 | { 13 | Value = value; 14 | } 15 | } 16 | 17 | public class MaterialExpressionDDYProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionDDY"; 20 | 21 | public MaterialExpressionDDYProcessor() 22 | { 23 | AddOptionalProperty("Value", PropertyDataType.AttributeList); 24 | } 25 | 26 | public override Node Convert(ParsedNode node, Node[] children) 27 | { 28 | return new MaterialExpressionDDY( 29 | node.FindAttributeValue("Name"), 30 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 32 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Value")) 33 | ); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Material/MaterialExpressionFrac.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionFrac : MaterialNode 7 | { 8 | public ParsedPropertyBag Input { get; } 9 | 10 | public MaterialExpressionFrac(string name, int editorX, int editorY, ParsedPropertyBag input) 11 | : base(name, editorX, editorY) 12 | { 13 | Input = input; 14 | } 15 | } 16 | 17 | public class MaterialExpressionFracProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionFrac"; 20 | 21 | public MaterialExpressionFracProcessor() 22 | { 23 | AddRequiredProperty("Input", PropertyDataType.AttributeList); 24 | } 25 | 26 | public override Node Convert(ParsedNode node, Node[] children) 27 | { 28 | return new MaterialExpressionFrac( 29 | node.FindAttributeValue("Name"), 30 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 32 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")) 33 | ); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Material/MaterialExpressionFloor.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionFloor : MaterialNode 7 | { 8 | public ParsedPropertyBag Input { get; } 9 | 10 | public MaterialExpressionFloor(string name, int editorX, int editorY, ParsedPropertyBag input) 11 | : base(name, editorX, editorY) 12 | { 13 | Input = input; 14 | } 15 | } 16 | 17 | public class MaterialExpressionFloorProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionFloor"; 20 | 21 | public MaterialExpressionFloorProcessor() 22 | { 23 | AddOptionalProperty("Input", PropertyDataType.AttributeList); 24 | } 25 | 26 | public override Node Convert(ParsedNode node, Node[] children) 27 | { 28 | return new MaterialExpressionFloor( 29 | node.FindAttributeValue("Name"), 30 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 32 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")) 33 | ); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Map/BaseComponentProcessor.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Common; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public abstract class BaseComponent : Node, ILocation, IRotation, IScale3D 7 | { 8 | public ResourceReference Archetype { get; } 9 | public Vector3 Location { get; } 10 | public Vector3 Scale3D { get; } 11 | public Rotator Rotation { get; } 12 | 13 | protected BaseComponent(string name, ResourceReference archetype, Vector3 relativeLocation, Vector3 relativeScale3D, Rotator relativeRotation, Node[] children = null) 14 | : base(name, children) 15 | { 16 | Archetype = archetype; 17 | Location = relativeLocation; 18 | Scale3D = relativeScale3D; 19 | Rotation = relativeRotation; 20 | } 21 | } 22 | 23 | public abstract class BaseComponentProcessor : ObjectNodeProcessor 24 | { 25 | public BaseComponentProcessor() 26 | { 27 | AddRequiredAttribute("Archetype", PropertyDataType.ResourceReference); 28 | 29 | AddOptionalProperty("RelativeLocation", PropertyDataType.Vector3); 30 | AddOptionalProperty("RelativeRotation", PropertyDataType.Rotator); 31 | AddOptionalProperty("RelativeScale3D", PropertyDataType.Vector3); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Material/MaterialExpressionConstant.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionConstant : MaterialNode 7 | { 8 | public float R { get; } 9 | 10 | public MaterialExpressionConstant(string name, int editorX, int editorY, float r) 11 | : base(name, editorX, editorY) 12 | { 13 | R = r; 14 | } 15 | } 16 | 17 | public class MaterialExpressionConstantProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionConstant"; 20 | 21 | public MaterialExpressionConstantProcessor() 22 | { 23 | AddOptionalProperty("R", PropertyDataType.Float); 24 | 25 | AddIgnoredProperty("bCollapsed"); 26 | } 27 | 28 | public override Node Convert(ParsedNode node, Node[] children) 29 | { 30 | return new MaterialExpressionConstant( 31 | node.FindAttributeValue("Name"), 32 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 34 | ValueUtil.ParseFloat(node.FindPropertyValue("R")) 35 | ); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Material/MaterialExpressionOneMinus.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionOneMinus : MaterialNode 7 | { 8 | public ParsedPropertyBag Input { get; } 9 | 10 | public MaterialExpressionOneMinus(string name, int editorX, int editorY, ParsedPropertyBag input) 11 | : base(name, editorX, editorY) 12 | { 13 | Input = input; 14 | } 15 | } 16 | 17 | public class MaterialExpressionOneMinusProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionOneMinus"; 20 | 21 | public MaterialExpressionOneMinusProcessor() 22 | { 23 | AddRequiredProperty("Input", PropertyDataType.AttributeList); 24 | } 25 | 26 | public override Node Convert(ParsedNode node, Node[] children) 27 | { 28 | return new MaterialExpressionOneMinus( 29 | node.FindAttributeValue("Name"), 30 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 32 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")) 33 | ); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Material/MaterialExpressionAbs.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionAbs : MaterialNode 7 | { 8 | public ParsedPropertyBag Input { get; } 9 | 10 | public MaterialExpressionAbs(string name, int editorX, int editorY, ParsedPropertyBag input) 11 | : base(name, editorX, editorY) 12 | { 13 | Input = input; 14 | } 15 | } 16 | 17 | public class MaterialExpressionAbsProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionAbs"; 20 | 21 | public MaterialExpressionAbsProcessor() 22 | { 23 | AddOptionalProperty("Input", PropertyDataType.AttributeList); 24 | 25 | AddIgnoredProperty("bRealtimePreview"); 26 | } 27 | 28 | public override Node Convert(ParsedNode node, Node[] children) 29 | { 30 | return new MaterialExpressionAbs( 31 | node.FindAttributeValue("Name"), 32 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 34 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")) 35 | ); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Material/MaterialExpressionNormalize.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionNormalize : MaterialNode 7 | { 8 | public ParsedPropertyBag VectorInput { get; } 9 | 10 | public MaterialExpressionNormalize(string name, int editorX, int editorY, ParsedPropertyBag vectorInput) 11 | : base(name, editorX, editorY) 12 | { 13 | VectorInput = vectorInput; 14 | } 15 | } 16 | 17 | public class MaterialExpressionNormalizeProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionNormalize"; 20 | 21 | public MaterialExpressionNormalizeProcessor() 22 | { 23 | AddOptionalProperty("VectorInput", PropertyDataType.AttributeList); 24 | } 25 | 26 | public override Node Convert(ParsedNode node, Node[] children) 27 | { 28 | return new MaterialExpressionNormalize( 29 | node.FindAttributeValue("Name"), 30 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 32 | ValueUtil.ParseAttributeList(node.FindPropertyValue("VectorInput")) 33 | ); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("JollySamurai.Unreal4.T3DParser")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("JollySamurai.Unreal4.T3DParser")] 12 | [assembly: AssemblyCopyright("Copyright © 2019")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("BB5D3C25-B20E-4426-B696-31FD17AE0102")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /Material/MaterialExpressionConstant2Vector.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionConstant2Vector : MaterialNode 7 | { 8 | public float R { get; } 9 | public float G { get; } 10 | 11 | public MaterialExpressionConstant2Vector(string name, int editorX, int editorY, float r, float g) 12 | : base(name, editorX, editorY) 13 | { 14 | R = r; 15 | G = g; 16 | } 17 | } 18 | 19 | public class MaterialExpressionConstant2VectorProcessor : MaterialNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionConstant2Vector"; 22 | 23 | public MaterialExpressionConstant2VectorProcessor() 24 | { 25 | AddOptionalProperty("G", PropertyDataType.Float); 26 | AddOptionalProperty("R", PropertyDataType.Float); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new MaterialExpressionConstant2Vector( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 35 | ValueUtil.ParseFloat(node.FindPropertyValue("R")), 36 | ValueUtil.ParseFloat(node.FindPropertyValue("G")) 37 | ); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Material/MaterialExpressionDistance.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionDistance : MaterialNode 7 | { 8 | public ParsedPropertyBag A { get; } 9 | public ParsedPropertyBag B { get; } 10 | 11 | public MaterialExpressionDistance(string name, int editorX, int editorY, ParsedPropertyBag a, ParsedPropertyBag b) 12 | : base(name, editorX, editorY) 13 | { 14 | A = a; 15 | B = b; 16 | } 17 | } 18 | 19 | public class MaterialExpressionDistanceProcessor : MaterialNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionDistance"; 22 | 23 | public MaterialExpressionDistanceProcessor() 24 | { 25 | AddOptionalProperty("A", PropertyDataType.AttributeList); 26 | AddOptionalProperty("B", PropertyDataType.AttributeList); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new MaterialExpressionDistance( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 35 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 36 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")) 37 | ); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Material/MaterialExpressionSine.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionSine : MaterialNode 7 | { 8 | public ParsedPropertyBag Input { get; } 9 | public float Period { get; } 10 | 11 | public MaterialExpressionSine(string name, int editorX, int editorY, ParsedPropertyBag input, float period) 12 | : base(name, editorX, editorY) 13 | { 14 | Input = input; 15 | Period = period; 16 | } 17 | } 18 | 19 | public class MaterialExpressionSineProcessor : MaterialNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionSine"; 22 | 23 | public MaterialExpressionSineProcessor() 24 | { 25 | AddRequiredProperty("Input", PropertyDataType.AttributeList); 26 | 27 | AddOptionalProperty("Period", PropertyDataType.Float); 28 | } 29 | 30 | public override Node Convert(ParsedNode node, Node[] children) 31 | { 32 | return new MaterialExpressionSine( 33 | node.FindAttributeValue("Name"), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 35 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 36 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")), 37 | ValueUtil.ParseFloat(node.FindPropertyValue("Period") ?? "1.0") 38 | ); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Material/MaterialExpressionWorldPosition.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionWorldPosition : MaterialNode 7 | { 8 | public WorldPositionIncludedOffsets WorldPositionIncludedOffsets { get; } 9 | 10 | public MaterialExpressionWorldPosition(string name, int editorX, int editorY, WorldPositionIncludedOffsets worldPositionIncludedOffsets) 11 | : base(name, editorX, editorY) 12 | { 13 | WorldPositionIncludedOffsets = worldPositionIncludedOffsets; 14 | } 15 | } 16 | 17 | public class MaterialExpressionWorldPositionProcessor : MaterialNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionWorldPosition"; 20 | 21 | public MaterialExpressionWorldPositionProcessor() 22 | { 23 | AddOptionalProperty("WorldPositionShaderOffset", PropertyDataType.WorldPositionIncludedOffsets); 24 | } 25 | 26 | public override Node Convert(ParsedNode node, Node[] children) 27 | { 28 | return new MaterialExpressionWorldPosition( 29 | node.FindAttributeValue("Name"), 30 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 32 | ValueUtil.ParseWorldPositionIncludedOffsets(node.FindPropertyValue("WorldPositionIncludedOffsets")) 33 | ); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Material/MaterialExpressionDotProduct.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionDotProduct : MaterialNode 7 | { 8 | public ParsedPropertyBag A { get; } 9 | public ParsedPropertyBag B { get; } 10 | 11 | public MaterialExpressionDotProduct(string name, int editorX, int editorY, ParsedPropertyBag a, ParsedPropertyBag b) 12 | : base(name, editorX, editorY) 13 | { 14 | A = a; 15 | B = b; 16 | } 17 | } 18 | 19 | public class MaterialExpressionDotProductProcessor : MaterialNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionDotProduct"; 22 | 23 | public MaterialExpressionDotProductProcessor() 24 | { 25 | AddOptionalProperty("A", PropertyDataType.AttributeList); 26 | AddOptionalProperty("B", PropertyDataType.AttributeList); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new MaterialExpressionDotProduct( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 35 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 36 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")) 37 | ); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Material/MaterialExpressionAppendVector.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionAppendVector : MaterialNode 7 | { 8 | public ParsedPropertyBag A { get; } 9 | public ParsedPropertyBag B { get; } 10 | 11 | public MaterialExpressionAppendVector(string name, int editorX, int editorY, ParsedPropertyBag a, ParsedPropertyBag b) 12 | : base(name, editorX, editorY) 13 | { 14 | A = a; 15 | B = b; 16 | } 17 | } 18 | 19 | public class MaterialExpressionAppendVectorProcessor : MaterialNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionAppendVector"; 22 | 23 | public MaterialExpressionAppendVectorProcessor() 24 | { 25 | AddOptionalProperty("A", PropertyDataType.AttributeList); 26 | AddOptionalProperty("B", PropertyDataType.AttributeList); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new MaterialExpressionAppendVector( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 35 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 36 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")) 37 | ); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Material/MaterialExpressionCrossProduct.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionCrossProduct : MaterialNode 7 | { 8 | public ParsedPropertyBag A { get; } 9 | public ParsedPropertyBag B { get; } 10 | 11 | public MaterialExpressionCrossProduct(string name, int editorX, int editorY, ParsedPropertyBag a, ParsedPropertyBag b) 12 | : base(name, editorX, editorY) 13 | { 14 | A = a; 15 | B = b; 16 | } 17 | } 18 | 19 | public class MaterialExpressionCrossProductProcessor : MaterialNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionCrossProduct"; 22 | 23 | public MaterialExpressionCrossProductProcessor() 24 | { 25 | AddOptionalProperty("A", PropertyDataType.AttributeList); 26 | AddOptionalProperty("B", PropertyDataType.AttributeList); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new MaterialExpressionCrossProduct( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 35 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 36 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")) 37 | ); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Material/MaterialExpressionVectorParameter.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionVectorParameter : ParameterNode 7 | { 8 | public MaterialExpressionVectorParameter(string name, int editorX, int editorY, string parameterName, Vector4 defaultValue) 9 | : base(name, editorX, editorY, parameterName, defaultValue) 10 | { 11 | } 12 | } 13 | 14 | public class MaterialExpressionVectorParameterProcessor : ParameterNodeProcessor 15 | { 16 | public override string Class => "/Script/Engine.MaterialExpressionVectorParameter"; 17 | 18 | public MaterialExpressionVectorParameterProcessor() 19 | { 20 | AddOptionalProperty("DefaultValue", PropertyDataType.Vector4); 21 | AddOptionalProperty("ParameterName", PropertyDataType.String); 22 | 23 | AddIgnoredProperty("ExpressionGUID"); 24 | AddIgnoredProperty("Group"); 25 | } 26 | 27 | public override Node Convert(ParsedNode node, Node[] children) 28 | { 29 | return new MaterialExpressionVectorParameter( 30 | node.FindAttributeValue("Name"), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 32 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 33 | node.FindPropertyValue("ParameterName") ?? "Param", 34 | ValueUtil.ParseVector4(node.FindPropertyValue("DefaultValue")) 35 | ); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Material/MaterialExpressionStaticBoolParameter.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionStaticBoolParameter : ParameterNode 7 | { 8 | public MaterialExpressionStaticBoolParameter(string name, int editorX, int editorY, string parameterName, bool defaultValue) 9 | : base(name, editorX, editorY, parameterName, defaultValue) 10 | { 11 | } 12 | } 13 | 14 | public class MaterialExpressionStaticBoolParameterProcessor : ParameterNodeProcessor 15 | { 16 | public override string Class => "/Script/Engine.MaterialExpressionStaticBoolParameter"; 17 | 18 | public MaterialExpressionStaticBoolParameterProcessor() 19 | { 20 | AddOptionalProperty("DefaultValue", PropertyDataType.Boolean); 21 | AddOptionalProperty("ParameterName", PropertyDataType.String); 22 | 23 | AddIgnoredProperty("ExpressionGUID"); 24 | AddIgnoredProperty("Group"); 25 | } 26 | 27 | public override Node Convert(ParsedNode node, Node[] children) 28 | { 29 | return new MaterialExpressionStaticBoolParameter( 30 | node.FindAttributeValue("Name"), 31 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 32 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 33 | node.FindPropertyValue("ParameterName") ?? "Param", 34 | ValueUtil.ParseBoolean(node.FindPropertyValue("DefaultValue")) 35 | ); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Material/MaterialExpressionTextureObject.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionTextureObject : MaterialNode 7 | { 8 | public ResourceReference Texture { get; } 9 | public SamplerType SamplerType { get; } 10 | 11 | public MaterialExpressionTextureObject(string name, int editorX, int editorY, ResourceReference texture, SamplerType samplerType) 12 | : base(name, editorX, editorY) 13 | { 14 | Texture = texture; 15 | SamplerType = samplerType; 16 | } 17 | } 18 | 19 | public class MaterialExpressionTextureObjectProcessor : MaterialNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionTextureObject"; 22 | 23 | public MaterialExpressionTextureObjectProcessor() 24 | { 25 | AddOptionalProperty("SamplerType", PropertyDataType.SamplerType); 26 | AddOptionalProperty("Texture", PropertyDataType.ResourceReference); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new MaterialExpressionTextureObject( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 35 | ValueUtil.ParseResourceReference(node.FindPropertyValue("Texture")), 36 | ValueUtil.ParseSamplerType(node.FindPropertyValue("SamplerType")) 37 | ); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Material/MaterialExpressionComment.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionComment : MaterialNode 7 | { 8 | public int SizeX { get; } 9 | public int SizeY { get; } 10 | public string Text { get; } 11 | 12 | public MaterialExpressionComment(string name, int editorX, int editorY, string text, int sizeX, int sizeY) 13 | : base(name, editorX, editorY) 14 | { 15 | SizeX = sizeX; 16 | SizeY = sizeY; 17 | Text = text; 18 | } 19 | } 20 | 21 | public class MaterialExpressionCommentProcessor : MaterialNodeProcessor 22 | { 23 | public override string Class => "/Script/Engine.MaterialExpressionComment"; 24 | 25 | public MaterialExpressionCommentProcessor() 26 | { 27 | AddRequiredProperty("SizeX", PropertyDataType.Integer); 28 | AddRequiredProperty("SizeY", PropertyDataType.Integer); 29 | AddRequiredProperty("Text", PropertyDataType.String); 30 | } 31 | 32 | public override Node Convert(ParsedNode node, Node[] children) 33 | { 34 | return new MaterialExpressionComment( 35 | node.FindAttributeValue("Name"), 36 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 37 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 38 | node.FindPropertyValue("Text"), 39 | ValueUtil.ParseInteger(node.FindPropertyValue("SizeX")), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("SizeY")) 41 | ); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Material/MaterialExpressionScalarParameter.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionScalarParameter : ParameterNode 7 | { 8 | public MaterialExpressionScalarParameter(string name, int editorX, int editorY, string parameterName, float defaultValue) 9 | : base(name, editorX, editorY, parameterName, defaultValue) 10 | { 11 | } 12 | } 13 | 14 | public class MaterialExpressionScalarParameterProcessor : ParameterNodeProcessor 15 | { 16 | public override string Class => "/Script/Engine.MaterialExpressionScalarParameter"; 17 | 18 | public MaterialExpressionScalarParameterProcessor() 19 | { 20 | AddOptionalProperty("DefaultValue", PropertyDataType.Float); 21 | AddOptionalProperty("ParameterName", PropertyDataType.String); 22 | 23 | AddIgnoredProperty("bCollapsed"); 24 | AddIgnoredProperty("ExpressionGUID"); 25 | AddIgnoredProperty("Group"); 26 | AddIgnoredProperty("SliderMax"); 27 | AddIgnoredProperty("SliderMin"); 28 | } 29 | 30 | public override Node Convert(ParsedNode node, Node[] children) 31 | { 32 | return new MaterialExpressionScalarParameter( 33 | node.FindAttributeValue("Name"), 34 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 35 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 36 | node.FindPropertyValue("ParameterName") ?? "Param", 37 | ValueUtil.ParseFloat(node.FindPropertyValue("DefaultValue")) 38 | ); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Map/SkyLight.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class SkyLight : BaseActorNode 8 | { 9 | public SkyLightComponent SkyLightComponent => Children.First(node => node.Name == RootComponentName) as SkyLightComponent; 10 | 11 | public SkyLight(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName) 12 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 13 | { 14 | } 15 | } 16 | 17 | public class SkyLightProcessor : BaseActorNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.SkyLight"; 20 | 21 | public SkyLightProcessor() 22 | { 23 | AddIgnoredProperty("Component"); 24 | AddIgnoredProperty("LightComponent"); 25 | AddIgnoredProperty("SpriteComponent"); 26 | } 27 | 28 | public override Node Convert(ParsedNode node, Node[] children) 29 | { 30 | return new SkyLight( 31 | node.FindAttributeValue("Name"), 32 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 33 | node.FindPropertyValue("ActorLabel"), 34 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 35 | node.FindPropertyValue("FolderPath"), 36 | node.FindPropertyValue("RootComponent"), 37 | children, 38 | node.FindAttributeValue("ParentActor") 39 | ); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Parser/ParsedPropertyBag.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace JollySamurai.UnrealEngine4.T3D.Parser 7 | { 8 | public class ParsedPropertyBag 9 | { 10 | public ParsedProperty[] Properties { get; } 11 | 12 | public static ParsedPropertyBag Empty { 13 | get { 14 | return new ParsedPropertyBag(new ParsedProperty[] { 15 | }); 16 | } 17 | } 18 | 19 | public ParsedPropertyBag(ParsedProperty[] properties) 20 | { 21 | Trace.Assert(properties != null); 22 | Properties = properties; 23 | } 24 | 25 | public ParsedProperty FindProperty(string name) 26 | { 27 | foreach (ParsedProperty parsedProperty in Properties) { 28 | if (parsedProperty.Name == name) { 29 | return parsedProperty; 30 | } 31 | } 32 | 33 | return null; 34 | } 35 | 36 | public string FindPropertyValue(string name) 37 | { 38 | return FindProperty(name)?.Value; 39 | } 40 | 41 | public bool HasProperty(string name) 42 | { 43 | return FindProperty(name) != null; 44 | } 45 | 46 | public bool HasPropertyWithValue(string name, string value) 47 | { 48 | ParsedProperty property = FindProperty(name); 49 | 50 | return null != property && property.Value == value; 51 | } 52 | 53 | public override string ToString() 54 | { 55 | var b = new List(); 56 | 57 | foreach (var parsedProperty in Properties) { 58 | b.Add($"{parsedProperty.Name}={parsedProperty.Value}"); 59 | } 60 | 61 | return string.Join(", ", b.ToArray()); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Map/ExponentialHeightFog.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class ExponentialHeightFog : BaseActorNode 8 | { 9 | public ExponentialHeightFogComponent ExponentialHeightFogComponent => Children.First(node => node.Name == RootComponentName) as ExponentialHeightFogComponent; 10 | 11 | public ExponentialHeightFog(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName) 12 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 13 | { 14 | } 15 | } 16 | 17 | public class ExponentialHeightFogProcessor : BaseActorNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.ExponentialHeightFog"; 20 | 21 | public ExponentialHeightFogProcessor() 22 | { 23 | AddIgnoredProperty("Component"); 24 | AddIgnoredProperty("SpriteComponent"); 25 | } 26 | 27 | public override Node Convert(ParsedNode node, Node[] children) 28 | { 29 | return new ExponentialHeightFog( 30 | node.FindAttributeValue("Name"), 31 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 32 | node.FindPropertyValue("ActorLabel"), 33 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 34 | node.FindPropertyValue("FolderPath"), 35 | node.FindPropertyValue("RootComponent"), 36 | children, 37 | node.FindAttributeValue("ParentActor") 38 | ); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Map/DecalActor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class DecalActor : BaseActorNode 8 | { 9 | public string DecalComponentName { get; } 10 | 11 | public DecalComponent DecalComponent => Children.First(node => node.Name == DecalComponentName) as DecalComponent; 12 | 13 | public DecalActor(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string decalComponentName) 14 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children) 15 | { 16 | DecalComponentName = decalComponentName; 17 | } 18 | } 19 | 20 | public class DecalActorProcessor : BaseActorNodeProcessor 21 | { 22 | public override string Class => "/Script/Engine.DecalActor"; 23 | 24 | public DecalActorProcessor() 25 | { 26 | AddRequiredProperty("Decal", PropertyDataType.String); 27 | 28 | AddIgnoredProperty("ArrowComponent"); 29 | AddIgnoredProperty("SpriteComponent"); 30 | } 31 | 32 | public override Node Convert(ParsedNode node, Node[] children) 33 | { 34 | return new DecalActor( 35 | node.FindAttributeValue("Name"), 36 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 37 | node.FindPropertyValue("ActorLabel"), 38 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 39 | node.FindPropertyValue("FolderPath"), 40 | node.FindPropertyValue("RootComponent"), 41 | children, 42 | node.FindPropertyValue("Decal") 43 | ); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Map/DecalComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class DecalComponent : BaseComponent 7 | { 8 | public ResourceReference DecalMaterial { get; } 9 | public Vector3 DeclSize { get; } 10 | 11 | public DecalComponent(string name, ResourceReference archetype, Vector3 relativeLocation, Rotator relativeRotation, Vector3 relativeScale3D, Node[] children, ResourceReference decalMaterial, Vector3 declSize) 12 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 13 | { 14 | DecalMaterial = decalMaterial; 15 | DeclSize = declSize; 16 | } 17 | } 18 | 19 | public class DecalComponentProcessor : BaseComponentProcessor 20 | { 21 | public override string Class => "/Script/Engine.DecalComponent"; 22 | 23 | public DecalComponentProcessor() 24 | { 25 | AddRequiredProperty("DecalMaterial", PropertyDataType.ResourceReference); 26 | AddOptionalProperty("DecalSize", PropertyDataType.ResourceReference); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new DecalComponent( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 34 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 35 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 36 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 37 | children, 38 | ValueUtil.ParseResourceReference(node.FindPropertyValue("DecalMaterial")), 39 | ValueUtil.ParseVector3(node.FindPropertyValue("DeclSize") ?? "(X=128.0,Y=256.0,Z=256.0)") 40 | ); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Material/MaterialExpressionDesaturation.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionDesaturation : MaterialNode 7 | { 8 | public bool Collapsed { get; } 9 | public ParsedPropertyBag Input { get; } 10 | public ParsedPropertyBag Fraction { get; } 11 | 12 | public MaterialExpressionDesaturation(string name, int editorX, int editorY, bool collapsed, ParsedPropertyBag input, ParsedPropertyBag fraction) 13 | : base(name, editorX, editorY) 14 | { 15 | Collapsed = collapsed; 16 | Input = input; 17 | Fraction = fraction; 18 | } 19 | } 20 | 21 | public class MaterialExpressionDesaturationProcessor : MaterialNodeProcessor 22 | { 23 | public override string Class => "/Script/Engine.MaterialExpressionDesaturation"; 24 | 25 | public MaterialExpressionDesaturationProcessor() 26 | { 27 | AddOptionalProperty("bCollapsed", PropertyDataType.Boolean); 28 | AddOptionalProperty("Input", PropertyDataType.AttributeList); 29 | AddOptionalProperty("Fraction", PropertyDataType.AttributeList); 30 | 31 | AddIgnoredProperty("bRealtimePreview"); 32 | } 33 | 34 | public override Node Convert(ParsedNode node, Node[] children) 35 | { 36 | return new MaterialExpressionDesaturation( 37 | node.FindAttributeValue("Name"), 38 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 39 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 40 | ValueUtil.ParseBoolean(node.FindPropertyValue("bCollapsed")), 41 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")), 42 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Fraction")) 43 | ); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Material/MaterialExpressionSceneDepth.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionSceneDepth : MaterialNode 7 | { 8 | public MaterialSceneAttributeInputMode InputMode { get; } 9 | public ParsedPropertyBag Input { get; } 10 | public Vector2 ConstInput { get; } 11 | 12 | public MaterialExpressionSceneDepth(string name, int editorX, int editorY, MaterialSceneAttributeInputMode inputMode, ParsedPropertyBag input, Vector2 constInput) 13 | : base(name, editorX, editorY) 14 | { 15 | InputMode = inputMode; 16 | Input = input; 17 | ConstInput = constInput; 18 | } 19 | } 20 | 21 | public class MaterialExpressionSceneDepthProcessor : MaterialNodeProcessor 22 | { 23 | public override string Class => "/Script/Engine.MaterialExpressionSceneDepth"; 24 | 25 | public MaterialExpressionSceneDepthProcessor() 26 | { 27 | AddOptionalProperty("InputMode", PropertyDataType.MaterialSceneAttributeInputMode); 28 | AddOptionalProperty("Input", PropertyDataType.AttributeList); 29 | AddOptionalProperty("ConstInput", PropertyDataType.Vector2); 30 | } 31 | 32 | public override Node Convert(ParsedNode node, Node[] children) 33 | { 34 | return new MaterialExpressionSceneDepth( 35 | node.FindAttributeValue("Name"), 36 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 37 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 38 | ValueUtil.ParseMaterialSceneAttributeInputMode(node.FindPropertyValue("InputMode")), 39 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")), 40 | ValueUtil.ParseVector2(node.FindPropertyValue("ConstInput")) 41 | ); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Material/MaterialExpressionTextureObjectParameter.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionTextureObjectParameter : ParameterNode 7 | { 8 | public SamplerType SamplerType { get; } 9 | 10 | public MaterialExpressionTextureObjectParameter(string name, int editorX, int editorY, string parameterName, ResourceReference resource, SamplerType samplerType) 11 | : base(name, editorX, editorY, parameterName, resource) 12 | { 13 | SamplerType = samplerType; 14 | } 15 | } 16 | 17 | public class MaterialExpressionTextureObjectParameterProcessor : ParameterNodeProcessor 18 | { 19 | public override string Class => "/Script/Engine.MaterialExpressionTextureObjectParameter"; 20 | 21 | public MaterialExpressionTextureObjectParameterProcessor() 22 | { 23 | AddOptionalProperty("ParameterName", PropertyDataType.String); 24 | AddOptionalProperty("SamplerType", PropertyDataType.SamplerType); 25 | AddOptionalProperty("Texture", PropertyDataType.ResourceReference); 26 | 27 | AddIgnoredProperty("ExpressionGUID"); 28 | AddIgnoredProperty("Group"); 29 | } 30 | 31 | public override Node Convert(ParsedNode node, Node[] children) 32 | { 33 | return new MaterialExpressionTextureObjectParameter( 34 | node.FindAttributeValue("Name"), 35 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 36 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 37 | node.FindPropertyValue("ParameterName") ?? "Param", 38 | ValueUtil.ParseResourceReference(node.FindPropertyValue("Texture")), 39 | ValueUtil.ParseSamplerType(node.FindPropertyValue("SamplerType")) 40 | ); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Material/MaterialExpressionSceneTexture.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionSceneTexture : MaterialNode 7 | { 8 | public ParsedPropertyBag Coordinates { get; } 9 | public SceneTextureId SceneTextureId { get; } 10 | public bool Filtered { get; } 11 | 12 | public MaterialExpressionSceneTexture(string name, int editorX, int editorY, ParsedPropertyBag coordinates, SceneTextureId sceneTextureId, bool bFiltered) 13 | : base(name, editorX, editorY) 14 | { 15 | Coordinates = coordinates; 16 | SceneTextureId = sceneTextureId; 17 | Filtered = bFiltered; 18 | } 19 | } 20 | 21 | public class MaterialExpressionSceneTextureProcessor : MaterialNodeProcessor 22 | { 23 | public override string Class => "/Script/Engine.MaterialExpressionSceneTexture"; 24 | 25 | public MaterialExpressionSceneTextureProcessor() 26 | { 27 | AddOptionalProperty("Coordinates", PropertyDataType.AttributeList); 28 | AddOptionalProperty("SceneTextureId", PropertyDataType.SceneTextureId); 29 | AddOptionalProperty("bFiltered", PropertyDataType.Boolean); 30 | } 31 | 32 | public override Node Convert(ParsedNode node, Node[] children) 33 | { 34 | return new MaterialExpressionSceneTexture( 35 | node.FindAttributeValue("Name"), 36 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 37 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 38 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Coordinates")), 39 | ValueUtil.ParseSceneTextureId(node.FindPropertyValue("SceneTextureId")), 40 | ValueUtil.ParseBoolean(node.FindPropertyValue("bFiltered")) 41 | ); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Map/StaticMeshActor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class StaticMeshActor : BaseActorNode 8 | { 9 | public string StaticMeshComponentName { get; } 10 | 11 | public StaticMeshComponent StaticMeshComponent => Children.First(node => node.Name == StaticMeshComponentName) as StaticMeshComponent; 12 | 13 | public StaticMeshActor(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName, string staticMeshComponentName) 14 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 15 | { 16 | StaticMeshComponentName = staticMeshComponentName; 17 | } 18 | } 19 | 20 | public class StaticMeshActorProcessor : BaseActorNodeProcessor 21 | { 22 | public override string Class => "/Script/Engine.StaticMeshActor"; 23 | 24 | public StaticMeshActorProcessor() 25 | { 26 | AddRequiredProperty("StaticMeshComponent", PropertyDataType.String); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new StaticMeshActor( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 34 | node.FindPropertyValue("ActorLabel"), 35 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 36 | node.FindPropertyValue("FolderPath"), 37 | node.FindPropertyValue("RootComponent"), 38 | children, 39 | node.FindAttributeValue("ParentActor"), 40 | node.FindPropertyValue("StaticMeshComponent") 41 | ); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Material/MaterialExpressionDivide.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionDivide : MaterialNode 7 | { 8 | public ParsedPropertyBag A { get; } 9 | public ParsedPropertyBag B { get; } 10 | public float ConstA { get; } 11 | public float ConstB { get; } 12 | 13 | public MaterialExpressionDivide(string name, int editorX, int editorY, ParsedPropertyBag a, ParsedPropertyBag b, float constA, float constB) 14 | : base(name, editorX, editorY) 15 | { 16 | A = a; 17 | B = b; 18 | ConstA = constA; 19 | ConstB = constB; 20 | } 21 | } 22 | 23 | public class MaterialExpressionDivideProcessor : MaterialNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.MaterialExpressionDivide"; 26 | 27 | public MaterialExpressionDivideProcessor() 28 | { 29 | AddOptionalProperty("A", PropertyDataType.AttributeList); 30 | AddOptionalProperty("B", PropertyDataType.AttributeList); 31 | AddOptionalProperty("ConstA", PropertyDataType.Float); 32 | AddOptionalProperty("ConstB", PropertyDataType.Float); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new MaterialExpressionDivide( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 41 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 42 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")), 43 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstA") ?? "1.0"), 44 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstB") ?? "2.0") 45 | ); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Map/SkeletalMeshActor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class SkeletalMeshActor : BaseActorNode 8 | { 9 | public string SkeletalMeshComponentName { get; } 10 | 11 | public SkeletalMeshComponent SkeletalMeshComponent => Children.First(node => node.Name == SkeletalMeshComponentName) as SkeletalMeshComponent; 12 | 13 | public SkeletalMeshActor(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName, string staticMeshComponentName) 14 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 15 | { 16 | SkeletalMeshComponentName = staticMeshComponentName; 17 | } 18 | } 19 | 20 | public class SkeletalMeshActorProcessor : BaseActorNodeProcessor 21 | { 22 | public override string Class => "/Script/Engine.SkeletalMeshActor"; 23 | 24 | public SkeletalMeshActorProcessor() 25 | { 26 | AddRequiredProperty("SkeletalMeshComponent", PropertyDataType.String); 27 | } 28 | 29 | public override Node Convert(ParsedNode node, Node[] children) 30 | { 31 | return new SkeletalMeshActor( 32 | node.FindAttributeValue("Name"), 33 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 34 | node.FindPropertyValue("ActorLabel"), 35 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 36 | node.FindPropertyValue("FolderPath"), 37 | node.FindPropertyValue("RootComponent"), 38 | children, 39 | node.FindAttributeValue("ParentActor"), 40 | node.FindPropertyValue("SkeletalMeshComponent") 41 | ); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Material/MaterialExpressionSubtract.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionSubtract : MaterialNode 7 | { 8 | public ParsedPropertyBag A { get; } 9 | public ParsedPropertyBag B { get; } 10 | public float ConstA { get; } 11 | public float ConstB { get; } 12 | 13 | public MaterialExpressionSubtract(string name, int editorX, int editorY, ParsedPropertyBag a, ParsedPropertyBag b, float constA, float constB) 14 | : base(name, editorX, editorY) 15 | { 16 | A = a; 17 | B = b; 18 | ConstA = constA; 19 | ConstB = constB; 20 | } 21 | } 22 | 23 | public class MaterialExpressionSubtractProcessor : MaterialNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.MaterialExpressionSubtract"; 26 | 27 | public MaterialExpressionSubtractProcessor() 28 | { 29 | AddOptionalProperty("A", PropertyDataType.AttributeList); 30 | AddOptionalProperty("B", PropertyDataType.AttributeList); 31 | 32 | AddOptionalProperty("ConstA", PropertyDataType.Float); 33 | AddOptionalProperty("ConstB", PropertyDataType.Float); 34 | } 35 | 36 | public override Node Convert(ParsedNode node, Node[] children) 37 | { 38 | return new MaterialExpressionSubtract( 39 | node.FindAttributeValue("Name"), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 41 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 42 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 43 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")), 44 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstA") ?? "1.0"), 45 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstB") ?? "1.0") 46 | ); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Material/MaterialExpressionTransform.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionTransform : MaterialNode 7 | { 8 | public ParsedPropertyBag Input { get; } 9 | public MaterialVectorCoordTransformSource TransformSourceType { get; } 10 | public MaterialVectorCoordTransform TransformType { get; } 11 | 12 | public MaterialExpressionTransform(string name, int editorX, int editorY, ParsedPropertyBag input, MaterialVectorCoordTransformSource transformSourceType, MaterialVectorCoordTransform transformType) 13 | : base(name, editorX, editorY) 14 | { 15 | Input = input; 16 | TransformSourceType = transformSourceType; 17 | TransformType = transformType; 18 | } 19 | } 20 | 21 | public class MaterialExpressionTransformProcessor : MaterialNodeProcessor 22 | { 23 | public override string Class => "/Script/Engine.MaterialExpressionTransform"; 24 | 25 | public MaterialExpressionTransformProcessor() 26 | { 27 | AddOptionalProperty("Input", PropertyDataType.AttributeList); 28 | AddOptionalProperty("TransformSourceType", PropertyDataType.MaterialVectorCoordTransformSource); 29 | AddOptionalProperty("TransformType", PropertyDataType.MaterialVectorCoordTransform); 30 | } 31 | 32 | public override Node Convert(ParsedNode node, Node[] children) 33 | { 34 | return new MaterialExpressionTransform( 35 | node.FindAttributeValue("Name"), 36 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 37 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 38 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")), 39 | ValueUtil.ParseMaterialVectorCoordTransformSource(node.FindPropertyValue("TransformSourceType")), 40 | ValueUtil.ParseMaterialVectorCoordTransform(node.FindPropertyValue("TransformType")) 41 | ); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Material/MaterialExpressionPower.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionPower : MaterialNode 7 | { 8 | public bool Collapsed { get; } 9 | public ParsedPropertyBag Value { get; } 10 | public ParsedPropertyBag Exponent { get; } 11 | public float ConstExponent { get; } 12 | 13 | public MaterialExpressionPower(string name, int editorX, int editorY, bool collapsed, ParsedPropertyBag value, ParsedPropertyBag exponent, float constExponent) 14 | : base(name, editorX, editorY) 15 | { 16 | Collapsed = collapsed; 17 | Value = value; 18 | Exponent = exponent; 19 | ConstExponent = constExponent; 20 | } 21 | } 22 | 23 | public class MaterialExpressionPowerProcessor : MaterialNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.MaterialExpressionPower"; 26 | 27 | public MaterialExpressionPowerProcessor() 28 | { 29 | AddRequiredProperty("Base", PropertyDataType.AttributeList); 30 | 31 | AddOptionalProperty("bCollapsed", PropertyDataType.Boolean); 32 | AddOptionalProperty("Exponent", PropertyDataType.AttributeList); 33 | AddOptionalProperty("ConstExponent", PropertyDataType.Float); 34 | } 35 | 36 | public override Node Convert(ParsedNode node, Node[] children) 37 | { 38 | return new MaterialExpressionPower( 39 | node.FindAttributeValue("Name"), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 41 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 42 | ValueUtil.ParseBoolean(node.FindPropertyValue("bCollapsed")), 43 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Base")), 44 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Exponent")), 45 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstExponent") ?? "2.0") 46 | ); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Map/DirectionalLightActor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class DirectionalLightActor : BaseActorNode 8 | { 9 | public string DirectionalLightComponentName { get; } 10 | 11 | public DirectionalLightComponent DirectionalLightComponent => Children.First(node => node.Name == DirectionalLightComponentName) as DirectionalLightComponent; 12 | 13 | public DirectionalLightActor(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName, string directionalLightComponentName) 14 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 15 | { 16 | DirectionalLightComponentName = directionalLightComponentName; 17 | } 18 | } 19 | 20 | public class DirectionalLightActorProcessor : BaseActorNodeProcessor 21 | { 22 | public override string Class => "/Script/Engine.DirectionalLight"; 23 | 24 | public DirectionalLightActorProcessor() 25 | { 26 | AddRequiredProperty("DirectionalLightComponent", PropertyDataType.String); 27 | 28 | AddIgnoredProperty("LightComponent"); 29 | } 30 | 31 | public override Node Convert(ParsedNode node, Node[] children) 32 | { 33 | return new DirectionalLightActor( 34 | node.FindAttributeValue("Name"), 35 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 36 | node.FindPropertyValue("ActorLabel"), 37 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 38 | node.FindPropertyValue("FolderPath"), 39 | node.FindPropertyValue("RootComponent"), 40 | children, 41 | node.FindAttributeValue("ParentActor"), 42 | node.FindPropertyValue("DirectionalLightComponent") 43 | ); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Material/MaterialExpressionStaticSwitch.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionStaticSwitch : MaterialNode 7 | { 8 | public ExpressionReference A { get; } 9 | public ExpressionReference B { get; } 10 | public ExpressionReference Value { get; } 11 | public bool DefaultValue { get; } 12 | 13 | public MaterialExpressionStaticSwitch(string name, int editorX, int editorY, ExpressionReference a, ExpressionReference b, ExpressionReference value, bool defaultValue) 14 | : base(name, editorX, editorY) 15 | { 16 | A = a; 17 | B = b; 18 | Value = value; 19 | DefaultValue = defaultValue; 20 | } 21 | } 22 | 23 | public class MaterialExpressionStaticSwitchProcessor : MaterialNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.MaterialExpressionStaticSwitch"; 26 | 27 | public MaterialExpressionStaticSwitchProcessor() 28 | { 29 | AddOptionalProperty("A", PropertyDataType.ExpressionReference); 30 | AddOptionalProperty("B", PropertyDataType.ExpressionReference); 31 | AddOptionalProperty("Value", PropertyDataType.ExpressionReference); 32 | AddOptionalProperty("DefaultValue", PropertyDataType.Boolean); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new MaterialExpressionStaticSwitch( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 41 | ValueUtil.ParseExpressionReference(node.FindPropertyValue("A")), 42 | ValueUtil.ParseExpressionReference(node.FindPropertyValue("B")), 43 | ValueUtil.ParseExpressionReference(node.FindPropertyValue("Value")), 44 | ValueUtil.ParseBoolean(node.FindPropertyValue("DefaultValue")) 45 | ); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Material/MaterialExpressionTextureCoordinate.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionTextureCoordinate : MaterialNode 7 | { 8 | public bool Collapsed { get; } 9 | public int CoordinateIndex { get; } 10 | public float UTiling { get; } 11 | public float VTiling { get; } 12 | 13 | public MaterialExpressionTextureCoordinate(string name, int editorX, int editorY, bool collapsed, int coordinateIndex, float uTiling, float vTiling) 14 | : base(name, editorX, editorY) 15 | { 16 | Collapsed = collapsed; 17 | CoordinateIndex = coordinateIndex; 18 | UTiling = uTiling; 19 | VTiling = vTiling; 20 | } 21 | } 22 | 23 | public class MaterialExpressionTextureCoordinateProcessor : MaterialNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.MaterialExpressionTextureCoordinate"; 26 | 27 | public MaterialExpressionTextureCoordinateProcessor() 28 | { 29 | AddOptionalProperty("bCollapsed", PropertyDataType.Boolean); 30 | AddOptionalProperty("CoordinateIndex", PropertyDataType.Integer); 31 | AddOptionalProperty("UTiling", PropertyDataType.Float); 32 | AddOptionalProperty("VTiling", PropertyDataType.Float); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new MaterialExpressionTextureCoordinate( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 41 | ValueUtil.ParseBoolean(node.FindPropertyValue("bCollapsed")), 42 | ValueUtil.ParseInteger(node.FindPropertyValue("CoordinateIndex")), 43 | ValueUtil.ParseFloat(node.FindPropertyValue("UTiling") ?? "1.0"), 44 | ValueUtil.ParseFloat(node.FindPropertyValue("VTiling") ?? "1.0") 45 | ); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Material/MaterialExpressionStaticSwitchParameter.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionStaticSwitchParameter : ParameterNode 7 | { 8 | public ParsedPropertyBag A { get; } 9 | public ParsedPropertyBag B { get; } 10 | 11 | public MaterialExpressionStaticSwitchParameter(string name, int editorX, int editorY, string parameterName, bool defaultValue, ParsedPropertyBag a, ParsedPropertyBag b) 12 | : base(name, editorX, editorY, parameterName, defaultValue) 13 | { 14 | A = a; 15 | B = b; 16 | } 17 | } 18 | 19 | public class MaterialExpressionStaticSwitchParameterProcessor : ParameterNodeProcessor 20 | { 21 | public override string Class => "/Script/Engine.MaterialExpressionStaticSwitchParameter"; 22 | 23 | public MaterialExpressionStaticSwitchParameterProcessor() 24 | { 25 | AddOptionalProperty("A", PropertyDataType.AttributeList); 26 | AddOptionalProperty("B", PropertyDataType.AttributeList); 27 | AddOptionalProperty("DefaultValue", PropertyDataType.Boolean); 28 | AddOptionalProperty("ParameterName", PropertyDataType.String); 29 | 30 | AddIgnoredProperty("bRealtimePreview"); 31 | AddIgnoredProperty("ExpressionGUID"); 32 | AddIgnoredProperty("Group"); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new MaterialExpressionStaticSwitchParameter( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 41 | node.FindPropertyValue("ParameterName") ?? "Param", 42 | ValueUtil.ParseBoolean(node.FindPropertyValue("DefaultValue")), 43 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 44 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")) 45 | ); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Material/MaterialExpressionComponentMask.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionComponentMask : MaterialNode 7 | { 8 | public ExpressionReference Input { get; } 9 | public bool R { get; } 10 | public bool G { get; } 11 | public bool B { get; } 12 | public bool A { get; } 13 | 14 | public MaterialExpressionComponentMask(string name,int editorX, int editorY, ExpressionReference input, bool r, bool g, bool b, bool a) 15 | : base(name, editorX, editorY) 16 | { 17 | Input = input; 18 | R = r; 19 | G = g; 20 | B = b; 21 | A = a; 22 | } 23 | } 24 | 25 | public class MaterialExpressionComponentMaskProcessor : MaterialNodeProcessor 26 | { 27 | public override string Class => "/Script/Engine.MaterialExpressionComponentMask"; 28 | 29 | public MaterialExpressionComponentMaskProcessor() 30 | { 31 | AddOptionalProperty("Input", PropertyDataType.ExpressionReference); 32 | AddOptionalProperty("R", PropertyDataType.Boolean); 33 | AddOptionalProperty("G", PropertyDataType.Boolean); 34 | AddOptionalProperty("B", PropertyDataType.Boolean); 35 | AddOptionalProperty("A", PropertyDataType.Boolean); 36 | } 37 | 38 | public override Node Convert(ParsedNode node, Node[] children) 39 | { 40 | return new MaterialExpressionComponentMask( 41 | node.FindAttributeValue("Name"), 42 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 43 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 44 | ValueUtil.ParseExpressionReference(node.FindPropertyValue("Input")), 45 | ValueUtil.ParseBoolean(node.FindPropertyValue("R")), 46 | ValueUtil.ParseBoolean(node.FindPropertyValue("G")), 47 | ValueUtil.ParseBoolean(node.FindPropertyValue("B")), 48 | ValueUtil.ParseBoolean(node.FindPropertyValue("A")) 49 | ); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Material/MaterialExpressionAdd.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionAdd : MaterialNode 7 | { 8 | public bool Collapsed { get; } 9 | public ParsedPropertyBag A { get; } 10 | public ParsedPropertyBag B { get; } 11 | public float ConstA { get; } 12 | public float ConstB { get; } 13 | 14 | public MaterialExpressionAdd(string name, bool collapsed, int editorX, int editorY, ParsedPropertyBag a, ParsedPropertyBag b, float constA, float constB) 15 | : base(name, editorX, editorY) 16 | { 17 | Collapsed = collapsed; 18 | A = a; 19 | B = b; 20 | ConstA = constA; 21 | ConstB = constB; 22 | } 23 | } 24 | 25 | public class MaterialExpressionAddProcessor : MaterialNodeProcessor 26 | { 27 | public override string Class => "/Script/Engine.MaterialExpressionAdd"; 28 | 29 | public MaterialExpressionAddProcessor() 30 | { 31 | AddOptionalProperty("bCollapsed", PropertyDataType.Boolean); 32 | AddOptionalProperty("A", PropertyDataType.AttributeList); 33 | AddOptionalProperty("B", PropertyDataType.AttributeList); 34 | AddOptionalProperty("ConstA", PropertyDataType.Float); 35 | AddOptionalProperty("ConstB", PropertyDataType.Float); 36 | } 37 | 38 | public override Node Convert(ParsedNode node, Node[] children) 39 | { 40 | return new MaterialExpressionAdd( 41 | node.FindAttributeValue("Name"), 42 | ValueUtil.ParseBoolean(node.FindPropertyValue("bCollapsed")), 43 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 44 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 45 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 46 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")), 47 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstA")), 48 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstB") ?? "1.0") 49 | ); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Material/MaterialExpressionMaterialFunctionCall.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Material 6 | { 7 | public class MaterialExpressionMaterialFunctionCall : MaterialNode 8 | { 9 | public ExpressionReference MaterialFunction { get; } 10 | public ParsedPropertyBag[] FunctionInputs { get; } 11 | 12 | public MaterialExpressionMaterialFunctionCall(string name, int editorX, int editorY, ExpressionReference materialFunction, ParsedPropertyBag[] functionInputs) 13 | : base(name, editorX, editorY) 14 | { 15 | MaterialFunction = materialFunction; 16 | FunctionInputs = functionInputs; 17 | } 18 | } 19 | 20 | public class MaterialExpressionObjectFunctionCallProcessor : MaterialNodeProcessor 21 | { 22 | public override string Class => "/Script/Engine.MaterialExpressionMaterialFunctionCall"; 23 | 24 | public MaterialExpressionObjectFunctionCallProcessor() 25 | { 26 | AddRequiredProperty("MaterialFunction", PropertyDataType.ExpressionReference); 27 | 28 | AddOptionalProperty("FunctionInputs", PropertyDataType.AttributeList | PropertyDataType.Array); 29 | 30 | AddIgnoredProperty("FunctionOutputs"); 31 | AddIgnoredProperty("Outputs"); 32 | } 33 | 34 | public override Node Convert(ParsedNode node, Node[] children) 35 | { 36 | var functionInputList = new List(); 37 | 38 | foreach (var parsedProperty in node.FindProperty("FunctionInputs")?.Elements ?? ParsedPropertyBag.Empty.Properties) { 39 | functionInputList.Add(ValueUtil.ParseAttributeList(parsedProperty?.Value)); 40 | } 41 | 42 | return new MaterialExpressionMaterialFunctionCall( 43 | node.FindAttributeValue("Name"), 44 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 45 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 46 | ValueUtil.ParseExpressionReference(node.FindPropertyValue("MaterialFunction")), 47 | functionInputList.ToArray() 48 | ); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Material/MaterialExpressionDepthFade.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionDepthFade : MaterialNode 7 | { 8 | public ExpressionReference InOpacity { get; } 9 | public ExpressionReference FadeDistance { get; } 10 | public float OpacityDefault { get; } 11 | public float FadeDistanceDefault { get; } 12 | 13 | public MaterialExpressionDepthFade(string name, int editorX, int editorY, ExpressionReference inOpacity, ExpressionReference fadeDistance, float opacityDefault, float fadeDistanceDefault) 14 | : base(name, editorX, editorY) 15 | { 16 | InOpacity = inOpacity; 17 | FadeDistance = fadeDistance; 18 | OpacityDefault = opacityDefault; 19 | FadeDistanceDefault = fadeDistanceDefault; 20 | } 21 | } 22 | 23 | public class MaterialExpressionDepthFadeProcessor : MaterialNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.MaterialExpressionDepthFade"; 26 | 27 | public MaterialExpressionDepthFadeProcessor() 28 | { 29 | AddOptionalProperty("InOpacity", PropertyDataType.ExpressionReference); 30 | AddOptionalProperty("FadeDistance", PropertyDataType.ExpressionReference); 31 | AddOptionalProperty("OpacityDefault", PropertyDataType.Float); 32 | AddOptionalProperty("FadeDistanceDefault", PropertyDataType.Float); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new MaterialExpressionDepthFade( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 40 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 41 | ValueUtil.ParseExpressionReference(node.FindPropertyValue("InOpacity")), 42 | ValueUtil.ParseExpressionReference(node.FindPropertyValue("FadeDistance")), 43 | ValueUtil.ParseFloat(node.FindPropertyValue("OpacityDefault") ?? "1.0"), 44 | ValueUtil.ParseFloat(node.FindPropertyValue("FadeDistanceDefault") ?? "100.0") 45 | ); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Map/MapDocumentProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class MapDocumentProcessor : DocumentProcessor 8 | { 9 | private readonly string[] IgnoredNodes = { 10 | "/Script/DatasmithContent.DatasmithAssetUserData", 11 | "/Script/Engine.ArrowComponent", 12 | "/Script/Engine.BillboardComponent", 13 | "/Script/Engine.DrawSphereComponent", 14 | "/Script/NavigationSystem.AbstractNavData" 15 | }; 16 | 17 | public MapDocumentProcessor() 18 | { 19 | AddNodeProcessor(new LevelProcessor()); 20 | AddNodeProcessor(new MapProcessor()); 21 | AddNodeProcessor(new DecalActorProcessor()); 22 | AddNodeProcessor(new DecalComponentProcessor()); 23 | AddNodeProcessor(new DirectionalLightActorProcessor()); 24 | AddNodeProcessor(new DirectionalLightComponentProcessor()); 25 | AddNodeProcessor(new ExponentialHeightFogProcessor()); 26 | AddNodeProcessor(new ExponentialHeightFogComponentProcessor()); 27 | AddNodeProcessor(new PointLightActorProcessor()); 28 | AddNodeProcessor(new PointLightComponentProcessor()); 29 | AddNodeProcessor(new PostProcessingVolumeProcessor()); 30 | AddNodeProcessor(new SkeletalMeshActorProcessor()); 31 | AddNodeProcessor(new SkeletalMeshComponentProcessor()); 32 | AddNodeProcessor(new SkyLightProcessor()); 33 | AddNodeProcessor(new SkyLightComponentProcessor()); 34 | AddNodeProcessor(new SphereReflectionCaptureActorProcessor()); 35 | AddNodeProcessor(new SphereReflectionCaptureComponentProcessor()); 36 | AddNodeProcessor(new SpotLightActorProcessor()); 37 | AddNodeProcessor(new SpotLightComponentProcessor()); 38 | AddNodeProcessor(new StaticMeshActorProcessor()); 39 | AddNodeProcessor(new StaticMeshComponentProcessor()); 40 | } 41 | 42 | protected override bool IsIgnoredNode(ParsedNode parsedNode) 43 | { 44 | var nodeClass = parsedNode.AttributeBag.FindProperty("Class")?.Value; 45 | 46 | return IgnoredNodes.Count(s => s == nodeClass) != 0; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Map/BaseActorNodeProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public abstract class BaseActorNode : Node 8 | { 9 | public string ActorLabel { get; } 10 | public SpawnCollisionHandlingMethod SpawnCollisionHandlingMethod { get; } 11 | public string FolderPath { get; } 12 | 13 | public ResourceReference Archetype { get; } 14 | public string ParentActorName { get; } 15 | 16 | public string RootComponentName { get; } 17 | 18 | public BaseComponent RootComponent => Children.First(node => node.Name == RootComponentName) as BaseComponent; 19 | 20 | protected BaseActorNode(string name, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, ResourceReference archetype, Node[] children = null, string parentActorName = null) 21 | : base(name, children) 22 | { 23 | ActorLabel = actorLabel; 24 | SpawnCollisionHandlingMethod = spawnCollisionHandlingMethod; 25 | FolderPath = folderPath; 26 | RootComponentName = rootComponentName; 27 | Archetype = archetype; 28 | ParentActorName = parentActorName; 29 | } 30 | } 31 | 32 | public abstract class BaseActorNodeProcessor : NodeProcessor 33 | { 34 | public abstract string Class { get; } 35 | 36 | public BaseActorNodeProcessor() 37 | { 38 | AddRequiredAttribute("Name", PropertyDataType.String); 39 | AddRequiredAttribute("Archetype", PropertyDataType.ResourceReference); 40 | 41 | AddOptionalAttribute("ParentActor", PropertyDataType.String); 42 | 43 | AddRequiredProperty("RootComponent", PropertyDataType.String); 44 | 45 | AddOptionalProperty("ActorLabel", PropertyDataType.String); 46 | AddOptionalProperty("FolderPath", PropertyDataType.String); 47 | AddOptionalProperty("SpawnCollisionHandlingMethod", PropertyDataType.String); 48 | 49 | AddIgnoredAttribute("Class"); 50 | } 51 | 52 | public override bool Supports(ParsedNode node) 53 | { 54 | return node.SectionType == "Actor" && Class == node.AttributeBag.FindProperty("Class")?.Value; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Material/MaterialExpressionMultiply.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionMultiply : MaterialNode 7 | { 8 | public bool Collapsed { get; } 9 | public ParsedPropertyBag A { get; } 10 | public ParsedPropertyBag B { get; } 11 | public float ConstA { get; } 12 | public float ConstB { get; } 13 | 14 | public MaterialExpressionMultiply(string name, int editorX, int editorY, bool collapsed, ParsedPropertyBag a, ParsedPropertyBag b, float constA, float constB) 15 | : base(name, editorX, editorY) 16 | { 17 | Collapsed = collapsed; 18 | A = a; 19 | B = b; 20 | ConstA = constA; 21 | ConstB = constB; 22 | } 23 | } 24 | 25 | public class MaterialExpressionMultiplyProcessor : MaterialNodeProcessor 26 | { 27 | public override string Class => "/Script/Engine.MaterialExpressionMultiply"; 28 | 29 | public MaterialExpressionMultiplyProcessor() 30 | { 31 | AddOptionalProperty("bCollapsed", PropertyDataType.Boolean); 32 | AddOptionalProperty("A", PropertyDataType.AttributeList); 33 | AddOptionalProperty("B", PropertyDataType.AttributeList); 34 | AddOptionalProperty("ConstA", PropertyDataType.Float); 35 | AddOptionalProperty("ConstB", PropertyDataType.Float); 36 | 37 | AddIgnoredProperty("bRealtimePreview"); 38 | } 39 | 40 | public override Node Convert(ParsedNode node, Node[] children) 41 | { 42 | return new MaterialExpressionMultiply( 43 | node.FindAttributeValue("Name"), 44 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 45 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 46 | ValueUtil.ParseBoolean(node.FindPropertyValue("bCollapsed")), 47 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 48 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")), 49 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstA")), 50 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstB") ?? "1.0") 51 | ); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Material/MaterialExpressionTextureSample.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionTextureSample : MaterialNode 7 | { 8 | public ParsedPropertyBag Coordinates { get; } 9 | 10 | public ResourceReference Texture { get; } 11 | public ParsedPropertyBag TextureObject { get; } 12 | public SamplerType SamplerType { get; } 13 | 14 | public MaterialExpressionTextureSample(string name, int editorX, int editorY, ParsedPropertyBag coordinates, ResourceReference texture, ParsedPropertyBag textureObject, SamplerType samplerType) 15 | : base(name, editorX, editorY) 16 | { 17 | Coordinates = coordinates; 18 | Texture = texture; 19 | TextureObject = textureObject; 20 | SamplerType = samplerType; 21 | } 22 | } 23 | 24 | public class MaterialExpressionTextureSampleProcessor : MaterialNodeProcessor 25 | { 26 | public override string Class => "/Script/Engine.MaterialExpressionTextureSample"; 27 | 28 | public MaterialExpressionTextureSampleProcessor() 29 | { 30 | AddOptionalProperty("Coordinates", PropertyDataType.AttributeList); 31 | AddOptionalProperty("SamplerType", PropertyDataType.SamplerType); 32 | AddOptionalProperty("Texture", PropertyDataType.ResourceReference); 33 | AddOptionalProperty("TextureObject", PropertyDataType.AttributeList); 34 | 35 | AddIgnoredProperty("bCollapsed"); 36 | } 37 | 38 | public override Node Convert(ParsedNode node, Node[] children) 39 | { 40 | return new MaterialExpressionTextureSample( 41 | node.FindAttributeValue("Name"), 42 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 43 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 44 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Coordinates")), 45 | ValueUtil.ParseResourceReference(node.FindPropertyValue("Texture")), 46 | ValueUtil.ParseAttributeList(node.FindPropertyValue("TextureObject")), 47 | ValueUtil.ParseSamplerType(node.FindPropertyValue("SamplerType")) 48 | ); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Map/PointLightActor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class PointLightActor : BaseActorNode 8 | { 9 | public string PointLightComponentName { get; } 10 | public string LightComponentName { get; } 11 | 12 | public PointLightComponent PointLightComponent => Children.First(node => node.Name == PointLightComponentName) as PointLightComponent; 13 | public PointLightComponent LightComponent => PointLightComponent; 14 | 15 | public PointLightActor(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName, string pointLightComponentName, string lightComponentName) 16 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 17 | { 18 | PointLightComponentName = pointLightComponentName; 19 | LightComponentName = lightComponentName; 20 | } 21 | } 22 | 23 | public class PointLightActorProcessor : BaseActorNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.PointLight"; 26 | 27 | public PointLightActorProcessor() 28 | { 29 | AddRequiredProperty("LightComponent", PropertyDataType.String); 30 | AddRequiredProperty("PointLightComponent", PropertyDataType.String); 31 | } 32 | 33 | public override Node Convert(ParsedNode node, Node[] children) 34 | { 35 | return new PointLightActor( 36 | node.FindAttributeValue("Name"), 37 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 38 | node.FindPropertyValue("ActorLabel"), 39 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 40 | node.FindPropertyValue("FolderPath"), 41 | node.FindPropertyValue("RootComponent"), 42 | children, 43 | node.FindAttributeValue("ParentActor"), 44 | node.FindPropertyValue("PointLightComponent"), 45 | node.FindPropertyValue("LightComponent") 46 | ); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Material/MaterialExpressionClamp.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionClamp : MaterialNode 7 | { 8 | public ParsedPropertyBag Input { get; } 9 | public ParsedPropertyBag Min { get; } 10 | public ParsedPropertyBag Max { get; } 11 | 12 | public float MinDefault { get; } 13 | public float MaxDefault { get; } 14 | 15 | public MaterialExpressionClamp(string name, int editorX, int editorY, ParsedPropertyBag input, ParsedPropertyBag min, ParsedPropertyBag max, float minDefault, float maxDefault) 16 | : base(name, editorX, editorY) 17 | { 18 | Input = input; 19 | Min = min; 20 | MinDefault = minDefault; 21 | Max = max; 22 | MaxDefault = maxDefault; 23 | } 24 | } 25 | 26 | public class MaterialExpressionClampProcessor : MaterialNodeProcessor 27 | { 28 | public override string Class => "/Script/Engine.MaterialExpressionClamp"; 29 | 30 | public MaterialExpressionClampProcessor() 31 | { 32 | AddRequiredProperty("Input", PropertyDataType.AttributeList); 33 | 34 | AddOptionalProperty("Max", PropertyDataType.AttributeList); 35 | AddOptionalProperty("MaxDefault", PropertyDataType.Float); 36 | AddOptionalProperty("Min", PropertyDataType.AttributeList); 37 | AddOptionalProperty("MinDefault", PropertyDataType.Float); 38 | } 39 | 40 | public override Node Convert(ParsedNode node, Node[] children) 41 | { 42 | return new MaterialExpressionClamp( 43 | node.FindAttributeValue("Name"), 44 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 45 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 46 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Input")), 47 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Min")), 48 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Max")), 49 | ValueUtil.ParseFloat(node.FindPropertyValue("MinDefault")), 50 | ValueUtil.ParseFloat(node.FindPropertyValue("MaxDefault") ?? "1") 51 | ); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Map/SphereReflectionCaptureActor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class SphereReflectionCaptureActor : BaseActorNode 8 | { 9 | public string CaptureComponentName { get; } 10 | 11 | public SphereReflectionCaptureComponent CaptureComponent => Children.First(node => node.Name == CaptureComponentName) as SphereReflectionCaptureComponent; 12 | 13 | public SphereReflectionCaptureActor(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName, string captureComponentName) 14 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 15 | { 16 | CaptureComponentName = captureComponentName; 17 | } 18 | } 19 | 20 | public class SphereReflectionCaptureActorProcessor : BaseActorNodeProcessor 21 | { 22 | public override string Class => "/Script/Engine.SphereReflectionCapture"; 23 | 24 | public SphereReflectionCaptureActorProcessor() 25 | { 26 | AddRequiredProperty("CaptureComponent", PropertyDataType.String); 27 | 28 | AddOptionalProperty("CaptureOffset", PropertyDataType.String); 29 | 30 | AddIgnoredProperty("CaptureOffsetComponent"); 31 | AddIgnoredProperty("DrawCaptureRadius"); 32 | AddIgnoredProperty("SpriteComponent"); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new SphereReflectionCaptureActor( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 40 | node.FindPropertyValue("ActorLabel"), 41 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 42 | node.FindPropertyValue("FolderPath"), 43 | node.FindPropertyValue("RootComponent"), 44 | children, 45 | node.FindAttributeValue("ParentActor"), 46 | node.FindPropertyValue("CaptureComponent") 47 | ); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Map/SpotLightActor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Map 6 | { 7 | public class SpotLightActor : BaseActorNode 8 | { 9 | public string SpotLightComponentName { get; } 10 | public string LightComponentName { get; } 11 | 12 | public SpotLightComponent SpotLightComponent => Children.First(node => node.Name == SpotLightComponentName) as SpotLightComponent; 13 | public SpotLightComponent LightComponent => SpotLightComponent; 14 | 15 | public SpotLightActor(string name, ResourceReference archetype, string actorLabel, SpawnCollisionHandlingMethod spawnCollisionHandlingMethod, string folderPath, string rootComponentName, Node[] children, string parentActorName, string spotLightComponentName, string lightComponentName) 16 | : base(name, actorLabel, spawnCollisionHandlingMethod, folderPath, rootComponentName, archetype, children, parentActorName) 17 | { 18 | SpotLightComponentName = spotLightComponentName; 19 | LightComponentName = lightComponentName; 20 | } 21 | } 22 | 23 | public class SpotLightActorProcessor : BaseActorNodeProcessor 24 | { 25 | public override string Class => "/Script/Engine.SpotLight"; 26 | 27 | public SpotLightActorProcessor() 28 | { 29 | AddRequiredProperty("LightComponent", PropertyDataType.String); 30 | AddRequiredProperty("SpotLightComponent", PropertyDataType.String); 31 | 32 | AddIgnoredProperty("ArrowComponent"); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new SpotLightActor( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 40 | node.FindPropertyValue("ActorLabel"), 41 | ValueUtil.ParseSpawnCollisionHandlingMethod(node.FindPropertyValue("SpawnCollisionHandlingMethod")), 42 | node.FindPropertyValue("FolderPath"), 43 | node.FindPropertyValue("RootComponent"), 44 | children, 45 | node.FindAttributeValue("ParentActor"), 46 | node.FindPropertyValue("SpotLightComponent"), 47 | node.FindPropertyValue("LightComponent") 48 | ); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Map/SkeletalMeshComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class SkeletalMeshComponent : BaseComponent, IMobility 7 | { 8 | public ResourceReference SkeletalMesh { get; } 9 | public ResourceReference[] OverrideMaterials { get; } 10 | public Mobility Mobility { get; } 11 | 12 | public SkeletalMeshComponent(string name, ResourceReference archetype, ResourceReference staticMesh, Vector3 relativeLocation, Rotator relativeRotation, Vector3 relativeScale3D, Node[] children, ResourceReference[] overrideMaterials, Mobility mobility) 13 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 14 | { 15 | SkeletalMesh = staticMesh; 16 | OverrideMaterials = overrideMaterials; 17 | Mobility = mobility; 18 | } 19 | } 20 | 21 | public class SkeletalMeshComponentProcessor : BaseComponentProcessor 22 | { 23 | public override string Class => "/Script/Engine.SkeletalMeshComponent"; 24 | 25 | public SkeletalMeshComponentProcessor() 26 | { 27 | AddRequiredProperty("SkeletalMesh", PropertyDataType.ResourceReference); 28 | 29 | AddOptionalProperty("Mobility", PropertyDataType.String); 30 | AddOptionalProperty("OverrideMaterials", PropertyDataType.ResourceReference | PropertyDataType.Array); 31 | 32 | AddIgnoredProperty("ClothingSimulationFactory"); 33 | } 34 | 35 | public override Node Convert(ParsedNode node, Node[] children) 36 | { 37 | return new SkeletalMeshComponent( 38 | node.FindAttributeValue("Name"), 39 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 40 | ValueUtil.ParseResourceReference(node.FindPropertyValue("SkeletalMesh")), 41 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 42 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 43 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 44 | children, 45 | ValueUtil.ParseResourceReferenceArray(node.FindProperty("OverrideMaterials")?.Elements), 46 | ValueUtil.ParseMobility(node.FindPropertyValue("Mobility")) 47 | ); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Material/MaterialExpressionTextureSampleParameter2D.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionTextureSampleParameter2D : ParameterNode 7 | { 8 | public ParsedPropertyBag Coordinates { get; } 9 | public ResourceReference Texture { get; } 10 | public SamplerType SamplerType { get; } 11 | 12 | public MaterialExpressionTextureSampleParameter2D(string name, int editorX, int editorY, string parameterName, ParsedPropertyBag coordinates, ResourceReference texture, SamplerType samplerType) 13 | : base(name, editorX, editorY, parameterName, null) 14 | { 15 | Coordinates = coordinates; 16 | Texture = texture; 17 | SamplerType = samplerType; 18 | } 19 | } 20 | 21 | public class MaterialExpressionTextureSampleParameter2DProcessor : ParameterNodeProcessor 22 | { 23 | public override string Class => "/Script/Engine.MaterialExpressionTextureSampleParameter2D"; 24 | 25 | public MaterialExpressionTextureSampleParameter2DProcessor() 26 | { 27 | AddRequiredProperty("Texture", PropertyDataType.ResourceReference); 28 | 29 | AddOptionalProperty("Coordinates", PropertyDataType.AttributeList); 30 | AddOptionalProperty("ParameterName", PropertyDataType.String); 31 | AddOptionalProperty("SamplerType", PropertyDataType.SamplerType); 32 | 33 | AddIgnoredProperty("bRealtimePreview"); 34 | AddIgnoredProperty("ExpressionGUID"); 35 | AddIgnoredProperty("Group"); 36 | } 37 | 38 | public override Node Convert(ParsedNode node, Node[] children) 39 | { 40 | return new MaterialExpressionTextureSampleParameter2D( 41 | node.FindAttributeValue("Name"), 42 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 43 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 44 | node.FindPropertyValue("ParameterName") ?? "Param", 45 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Coordinates")), 46 | ValueUtil.ParseResourceReference(node.FindPropertyValue("Texture")), 47 | ValueUtil.ParseSamplerType(node.FindPropertyValue("SamplerType")) 48 | ); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Material/MaterialExpressionRotateAboutAxis.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionRotateAboutAxis : MaterialNode 7 | { 8 | public ParsedPropertyBag NormalizedRotationAxis { get; } 9 | public ParsedPropertyBag RotationAngle { get; } 10 | public ParsedPropertyBag PivotPoint { get; } 11 | public ParsedPropertyBag Position { get; } 12 | public float Period { get; } 13 | 14 | public MaterialExpressionRotateAboutAxis(string name, int editorX, int editorY, ParsedPropertyBag normalizedRotationAxis, ParsedPropertyBag rotationAngle, ParsedPropertyBag pivotPoint, ParsedPropertyBag position, float period) 15 | : base(name, editorX, editorY) 16 | { 17 | NormalizedRotationAxis = normalizedRotationAxis; 18 | RotationAngle = rotationAngle; 19 | PivotPoint = pivotPoint; 20 | Position = position; 21 | Period = period; 22 | } 23 | } 24 | 25 | public class MaterialExpressionRotateAboutAxisProcessor : MaterialNodeProcessor 26 | { 27 | public override string Class => "/Script/Engine.MaterialExpressionRotateAboutAxis"; 28 | 29 | public MaterialExpressionRotateAboutAxisProcessor() 30 | { 31 | AddOptionalProperty("NormalizedRotationAxis", PropertyDataType.AttributeList); 32 | AddOptionalProperty("Period", PropertyDataType.Float); 33 | AddOptionalProperty("PivotPoint", PropertyDataType.AttributeList); 34 | AddOptionalProperty("Position", PropertyDataType.AttributeList); 35 | AddOptionalProperty("RotationAngle", PropertyDataType.AttributeList); 36 | } 37 | 38 | public override Node Convert(ParsedNode node, Node[] children) 39 | { 40 | return new MaterialExpressionRotateAboutAxis( 41 | node.FindAttributeValue("Name"), 42 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 43 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 44 | ValueUtil.ParseAttributeList(node.FindPropertyValue("NormalizedRotationAxis")), 45 | ValueUtil.ParseAttributeList(node.FindPropertyValue("RotationAngle")), 46 | ValueUtil.ParseAttributeList(node.FindPropertyValue("PivotPoint")), 47 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Position")), 48 | ValueUtil.ParseFloat(node.FindPropertyValue("Period") ?? "1.0") 49 | ); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Processor/NodeProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using JollySamurai.UnrealEngine4.T3D.Parser; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Processor 6 | { 7 | public abstract class NodeProcessor 8 | { 9 | public PropertyDefinition[] AttributeDefinitions { 10 | get => _attributeDefinitions.Values.ToArray(); 11 | } 12 | 13 | public PropertyDefinition[] PropertyDefinitions { 14 | get => _propertyDefinitions.Values.ToArray(); 15 | } 16 | 17 | public string[] IgnoredAttributeNames { 18 | get => _ignoredAttributes.ToArray(); 19 | } 20 | 21 | public string[] IgnoredPropertyNames { 22 | get => _ignoredProperties.ToArray(); 23 | } 24 | 25 | private Dictionary _attributeDefinitions; 26 | private Dictionary _propertyDefinitions; 27 | 28 | private List _ignoredAttributes; 29 | private List _ignoredProperties; 30 | 31 | public NodeProcessor() 32 | { 33 | _attributeDefinitions = new Dictionary(); 34 | _propertyDefinitions = new Dictionary(); 35 | 36 | _ignoredAttributes = new List(); 37 | _ignoredProperties = new List(); 38 | } 39 | 40 | public abstract bool Supports(ParsedNode node); 41 | 42 | public abstract Node Convert(ParsedNode node, Node[] children); 43 | 44 | protected void AddIgnoredAttribute(string name) 45 | { 46 | _ignoredAttributes.Add(name); 47 | } 48 | 49 | protected void AddIgnoredProperty(string name) 50 | { 51 | _ignoredProperties.Add(name); 52 | } 53 | 54 | protected void AddRequiredAttribute(string name, PropertyDataType propertyDataType) 55 | { 56 | _attributeDefinitions.Add(name, new PropertyDefinition(name, propertyDataType, true)); 57 | } 58 | 59 | protected void AddOptionalAttribute(string name, PropertyDataType propertyDataType) 60 | { 61 | _attributeDefinitions.Add(name, new PropertyDefinition(name, propertyDataType, false)); 62 | } 63 | 64 | protected void AddRequiredProperty(string name, PropertyDataType propertyDataType) 65 | { 66 | _propertyDefinitions.Add(name, new PropertyDefinition(name, propertyDataType, true)); 67 | } 68 | 69 | protected void AddOptionalProperty(string name, PropertyDataType propertyDataType) 70 | { 71 | _propertyDefinitions.Add(name, new PropertyDefinition(name, propertyDataType, false)); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Material/MaterialExpressionFresnel.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionFresnel : MaterialNode 7 | { 8 | public ParsedPropertyBag BaseReflectFractionIn { get; } 9 | public float BaseReflectFraction { get; } 10 | public ParsedPropertyBag ExponentIn { get; } 11 | public float Exponent { get; } 12 | public ParsedPropertyBag Power { get; } 13 | public ParsedPropertyBag Normal { get; } 14 | 15 | public MaterialExpressionFresnel(string name, int editorX, int editorY, ParsedPropertyBag baseReflectFractionIn, float baseReflectFraction, ParsedPropertyBag exponentIn, float exponent, ParsedPropertyBag power, ParsedPropertyBag normal) 16 | : base(name, editorX, editorY) 17 | { 18 | BaseReflectFractionIn = baseReflectFractionIn; 19 | BaseReflectFraction = baseReflectFraction; 20 | ExponentIn = exponentIn; 21 | Exponent = exponent; 22 | Power = power; 23 | Normal = normal; 24 | } 25 | } 26 | 27 | public class MaterialExpressionFresnelProcessor : MaterialNodeProcessor 28 | { 29 | public override string Class => "/Script/Engine.MaterialExpressionFresnel"; 30 | 31 | public MaterialExpressionFresnelProcessor() 32 | { 33 | AddOptionalProperty("BaseReflectFraction", PropertyDataType.Float); 34 | AddOptionalProperty("BaseReflectFractionIn", PropertyDataType.AttributeList); 35 | AddOptionalProperty("Exponent", PropertyDataType.Float); 36 | AddOptionalProperty("ExponentIn", PropertyDataType.AttributeList); 37 | AddOptionalProperty("Normal", PropertyDataType.AttributeList); 38 | AddOptionalProperty("Power", PropertyDataType.AttributeList); 39 | } 40 | 41 | public override Node Convert(ParsedNode node, Node[] children) 42 | { 43 | return new MaterialExpressionFresnel( 44 | node.FindAttributeValue("Name"), 45 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 46 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 47 | ValueUtil.ParseAttributeList(node.FindPropertyValue("BaseReflectFractionIn")), 48 | ValueUtil.ParseFloat(node.FindPropertyValue("BaseReflectFraction") ?? "0.04"), 49 | ValueUtil.ParseAttributeList(node.FindPropertyValue("ExponentIn")), 50 | ValueUtil.ParseFloat(node.FindPropertyValue("Exponent") ?? "5.0"), 51 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Power")), 52 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Normal")) 53 | ); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /MaterialInstance/MaterialInstance.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Common; 3 | using JollySamurai.UnrealEngine4.T3D.Material; 4 | using JollySamurai.UnrealEngine4.T3D.Parser; 5 | using JollySamurai.UnrealEngine4.T3D.Processor; 6 | 7 | namespace JollySamurai.UnrealEngine4.T3D.MaterialInstance 8 | { 9 | public class MaterialInstance : Node 10 | { 11 | public ParsedPropertyBag[] ScalarParameters { get; } 12 | public ParsedPropertyBag[] TextureParameters { get; } 13 | public ParsedPropertyBag[] VectorParameters { get; } 14 | 15 | public MaterialInstance(string name, Node[] children, ParsedPropertyBag[] scalarParameters, ParsedPropertyBag[] textureParameters, ParsedPropertyBag[] vectorParameters) 16 | : base(name, children) 17 | { 18 | ScalarParameters = scalarParameters; 19 | TextureParameters = textureParameters; 20 | VectorParameters = vectorParameters; 21 | } 22 | } 23 | 24 | public class MaterialInstanceProcessor : ObjectNodeProcessor 25 | { 26 | public override string Class { 27 | get { return "/Script/Engine.MaterialInstanceConstant"; } 28 | } 29 | 30 | public MaterialInstanceProcessor() 31 | { 32 | AddRequiredProperty("Parent", PropertyDataType.String); 33 | 34 | AddOptionalProperty("ScalarParameterValues", PropertyDataType.AttributeList | PropertyDataType.Array); 35 | AddOptionalProperty("TextureParameterValues", PropertyDataType.AttributeList | PropertyDataType.Array); 36 | AddOptionalProperty("VectorParameterValues", PropertyDataType.AttributeList | PropertyDataType.Array); 37 | 38 | AddIgnoredProperty("bHasStaticPermutationResource"); 39 | AddIgnoredProperty("CachedReferencedTextures"); 40 | AddIgnoredProperty("LightingGuid"); 41 | AddIgnoredProperty("ParameterStateId"); 42 | AddIgnoredProperty("PreviewMesh"); 43 | AddIgnoredProperty("ReferencedTextureGuids"); 44 | AddIgnoredProperty("TextureStreamingData"); 45 | AddIgnoredProperty("TextureStreamingDataVersion"); 46 | AddIgnoredProperty("ThumbnailInfo"); 47 | } 48 | 49 | public override Node Convert(ParsedNode node, Node[] children) 50 | { 51 | ParsedProperty expressionList = node.FindProperty("Expressions"); 52 | 53 | return new MaterialInstance( 54 | node.FindAttributeValue("Name"), 55 | children, 56 | ValueUtil.ParseAttributeListArray(node.FindProperty("ScalarParameterValues")?.Elements), 57 | ValueUtil.ParseAttributeListArray(node.FindProperty("TextureParameterValues")?.Elements), 58 | ValueUtil.ParseAttributeListArray(node.FindProperty("VectorParameterValues")?.Elements) 59 | ); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Material/MaterialExpressionPanner.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionPanner : MaterialNode 7 | { 8 | public ParsedPropertyBag Coordinate { get; } 9 | public ParsedPropertyBag Speed { get; } 10 | public ParsedPropertyBag Time { get; } 11 | 12 | public float SpeedX { get; } 13 | public float SpeedY { get; } 14 | public int ConstCoordinate { get; } 15 | public bool FractionalPart { get; } 16 | 17 | public MaterialExpressionPanner(string name, int editorX, int editorY, ParsedPropertyBag speed, ParsedPropertyBag coordinate, ParsedPropertyBag time, float speedX, float speedY, int constCoordinate, bool fractionalPart) 18 | : base(name, editorX, editorY) 19 | { 20 | Speed = speed; 21 | Coordinate = coordinate; 22 | Time = time; 23 | SpeedX = speedX; 24 | SpeedY = speedY; 25 | ConstCoordinate = constCoordinate; 26 | FractionalPart = fractionalPart; 27 | } 28 | } 29 | 30 | public class MaterialExpressionPannerProcessor : MaterialNodeProcessor 31 | { 32 | public override string Class => "/Script/Engine.MaterialExpressionPanner"; 33 | 34 | public MaterialExpressionPannerProcessor() 35 | { 36 | AddOptionalProperty("bFractionalPart", PropertyDataType.Boolean); 37 | AddOptionalProperty("ConstCoordinate", PropertyDataType.Integer); 38 | AddOptionalProperty("Coordinate", PropertyDataType.AttributeList); 39 | AddOptionalProperty("Speed", PropertyDataType.AttributeList); 40 | AddOptionalProperty("SpeedX", PropertyDataType.Float); 41 | AddOptionalProperty("SpeedY", PropertyDataType.Float); 42 | AddOptionalProperty("Time", PropertyDataType.AttributeList); 43 | } 44 | 45 | public override Node Convert(ParsedNode node, Node[] children) 46 | { 47 | return new MaterialExpressionPanner( 48 | node.FindAttributeValue("Name"), 49 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 50 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 51 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Speed")), 52 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Coordinate")), 53 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Time")), 54 | ValueUtil.ParseFloat(node.FindPropertyValue("SpeedX")), 55 | ValueUtil.ParseFloat(node.FindPropertyValue("SpeedY")), 56 | ValueUtil.ParseInteger(node.FindPropertyValue("ConstCoordinate")), 57 | ValueUtil.ParseBoolean(node.FindPropertyValue("bFractionalPart")) 58 | ); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Material/MaterialExpressionLinearInterpolate.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Material 5 | { 6 | public class MaterialExpressionLinearInterpolate : MaterialNode 7 | { 8 | public bool Collapsed { get; } 9 | public ParsedPropertyBag A { get; } 10 | public ParsedPropertyBag B { get; } 11 | public ParsedPropertyBag Alpha { get; } 12 | public float ConstA { get; } 13 | public float ConstB { get; } 14 | public float ConstAlpha { get; } 15 | 16 | public MaterialExpressionLinearInterpolate(string name, int editorX, int editorY, bool collapsed, ParsedPropertyBag a, ParsedPropertyBag b, ParsedPropertyBag alpha, float constA, float constB, float constAlpha) 17 | : base(name, editorX, editorY) 18 | { 19 | Collapsed = collapsed; 20 | A = a; 21 | B = b; 22 | Alpha = alpha; 23 | ConstA = constA; 24 | ConstB = constB; 25 | ConstAlpha = constAlpha; 26 | } 27 | } 28 | 29 | public class MaterialExpressionLinearInterpolateProcessor : MaterialNodeProcessor 30 | { 31 | public override string Class => "/Script/Engine.MaterialExpressionLinearInterpolate"; 32 | 33 | public MaterialExpressionLinearInterpolateProcessor() 34 | { 35 | AddOptionalProperty("bCollapsed", PropertyDataType.Boolean); 36 | AddOptionalProperty("A", PropertyDataType.AttributeList); 37 | AddOptionalProperty("Alpha", PropertyDataType.AttributeList); 38 | AddOptionalProperty("B", PropertyDataType.AttributeList); 39 | AddOptionalProperty("ConstA", PropertyDataType.Float); 40 | AddOptionalProperty("ConstB", PropertyDataType.Float); 41 | AddOptionalProperty("ConstAlpha", PropertyDataType.Float); 42 | 43 | AddIgnoredProperty("bRealtimePreview"); 44 | } 45 | 46 | public override Node Convert(ParsedNode node, Node[] children) 47 | { 48 | return new MaterialExpressionLinearInterpolate( 49 | node.FindAttributeValue("Name"), 50 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorX")), 51 | ValueUtil.ParseInteger(node.FindPropertyValue("MaterialExpressionEditorY")), 52 | ValueUtil.ParseBoolean(node.FindPropertyValue("bCollapsed")), 53 | ValueUtil.ParseAttributeList(node.FindPropertyValue("A")), 54 | ValueUtil.ParseAttributeList(node.FindPropertyValue("B")), 55 | ValueUtil.ParseAttributeList(node.FindPropertyValue("Alpha")), 56 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstA")), 57 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstB") ?? "1.0"), 58 | ValueUtil.ParseFloat(node.FindPropertyValue("ConstAlpha") ?? "0.5") 59 | ); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Map/StaticMeshComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class StaticMeshComponent : BaseComponent, IMobility 7 | { 8 | public ResourceReference StaticMesh { get; } 9 | public int StaticMeshImportVersion { get; } 10 | public ResourceReference[] OverrideMaterials { get; } 11 | public Mobility Mobility { get; } 12 | 13 | public StaticMeshComponent(string name, ResourceReference archetype, ResourceReference staticMesh, int staticMeshImportVersion, Vector3 relativeLocation, Rotator relativeRotation, Vector3 relativeScale3D, Node[] children, ResourceReference[] overrideMaterials, Mobility mobility) 14 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 15 | { 16 | StaticMesh = staticMesh; 17 | StaticMeshImportVersion = staticMeshImportVersion; 18 | OverrideMaterials = overrideMaterials; 19 | Mobility = mobility; 20 | } 21 | } 22 | 23 | public class StaticMeshComponentProcessor : BaseComponentProcessor 24 | { 25 | public override string Class => "/Script/Engine.StaticMeshComponent"; 26 | 27 | public StaticMeshComponentProcessor() 28 | { 29 | AddRequiredProperty("StaticMesh", PropertyDataType.ResourceReference); 30 | 31 | AddOptionalProperty("Mobility", PropertyDataType.String); 32 | AddOptionalProperty("OverrideMaterials", PropertyDataType.ResourceReference | PropertyDataType.Array); 33 | AddOptionalProperty("StaticMeshImportVersion", PropertyDataType.Integer); 34 | 35 | AddIgnoredProperty("AssetUserData"); 36 | AddIgnoredProperty("MaterialStreamingRelativeBoxes"); 37 | AddIgnoredProperty("StreamingTextureData"); 38 | AddIgnoredProperty("StaticMeshDerivedDataKey"); 39 | AddIgnoredProperty("VisibilityId"); 40 | } 41 | 42 | public override Node Convert(ParsedNode node, Node[] children) 43 | { 44 | return new StaticMeshComponent( 45 | node.FindAttributeValue("Name"), 46 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 47 | ValueUtil.ParseResourceReference(node.FindPropertyValue("StaticMesh")), 48 | ValueUtil.ParseInteger(node.FindPropertyValue("StaticMeshImportVersion")), 49 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 50 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 51 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 52 | children, 53 | ValueUtil.ParseResourceReferenceArray(node.FindProperty("OverrideMaterials")?.Elements), 54 | ValueUtil.ParseMobility(node.FindPropertyValue("Mobility")) 55 | ); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Map/SphereReflectionCaptureComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class SphereReflectionCaptureComponent : BaseComponent 7 | { 8 | public float Brightness { get; } 9 | public float InfluenceRadius { get; } 10 | public ReflectionSourceType ReflectionSourceType { get; } 11 | public ResourceReference Cubemap { get; } 12 | public float SourceCubemapAngle { get; } 13 | public Vector3 CaptureOffset { get; } 14 | 15 | public SphereReflectionCaptureComponent(string name, ResourceReference archetype, Vector3 relativeLocation, Rotator relativeRotation, Vector3 relativeScale3D, Node[] children, float brightness, float influenceRadius, ReflectionSourceType reflectionSourceType, ResourceReference cubemap, float sourceCubemapAngle, Vector3 captureOffset) 16 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 17 | { 18 | Brightness = brightness; 19 | InfluenceRadius = influenceRadius; 20 | ReflectionSourceType = reflectionSourceType; 21 | Cubemap = cubemap; 22 | SourceCubemapAngle = sourceCubemapAngle; 23 | CaptureOffset = captureOffset; 24 | } 25 | } 26 | 27 | public class SphereReflectionCaptureComponentProcessor : BaseComponentProcessor 28 | { 29 | public override string Class => "/Script/Engine.SphereReflectionCaptureComponent"; 30 | 31 | public SphereReflectionCaptureComponentProcessor() 32 | { 33 | AddOptionalProperty("CaptureOffset", PropertyDataType.Vector3); 34 | AddOptionalProperty("Cubemap", PropertyDataType.ResourceReference); 35 | AddOptionalProperty("InfluenceRadius", PropertyDataType.Float); 36 | AddOptionalProperty("SourceCubemapAngle", PropertyDataType.Float); 37 | AddOptionalProperty("SphereReflectionCaptureSize", PropertyDataType.Float); 38 | 39 | AddIgnoredProperty("CaptureOffsetComponent"); 40 | AddIgnoredProperty("MapBuildDataId"); 41 | AddIgnoredProperty("PreviewInfluenceRadius"); 42 | } 43 | 44 | public override Node Convert(ParsedNode node, Node[] children) 45 | { 46 | return new SphereReflectionCaptureComponent( 47 | node.FindAttributeValue("Name"), 48 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 49 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 50 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 51 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 52 | children, 53 | ValueUtil.ParseFloat(node.FindPropertyValue("Brightness") ?? "1"), 54 | ValueUtil.ParseFloat(node.FindPropertyValue("InfluenceRadius") ?? "3000"), 55 | ValueUtil.ParseReflectionSourceType(node.FindPropertyValue("ReflectionSourceType") ?? "CapturedScene"), 56 | ValueUtil.ParseResourceReference(node.FindPropertyValue("Cubemap")), 57 | ValueUtil.ParseFloat(node.FindPropertyValue("SourceCubemapAngle")), 58 | ValueUtil.ParseVector3(node.FindPropertyValue("CaptureOffset")) 59 | ); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | [*] 3 | charset=utf-8 4 | end_of_line=lf 5 | trim_trailing_whitespace=false 6 | insert_final_newline=true 7 | indent_style=space 8 | indent_size=4 9 | 10 | # Microsoft .NET properties 11 | csharp_new_line_before_catch=false 12 | csharp_new_line_before_else=false 13 | csharp_new_line_before_finally=false 14 | csharp_new_line_before_open_brace=types,local_functions,methods 15 | csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion 16 | csharp_style_var_elsewhere=true:hint 17 | csharp_style_var_for_built_in_types=true:hint 18 | csharp_style_var_when_type_is_apparent=true:hint 19 | dotnet_style_predefined_type_for_locals_parameters_members=true:hint 20 | dotnet_style_predefined_type_for_member_access=true:hint 21 | dotnet_style_qualification_for_event=false:hint 22 | dotnet_style_qualification_for_field=false:hint 23 | dotnet_style_qualification_for_method=false:hint 24 | dotnet_style_qualification_for_property=false:hint 25 | dotnet_style_require_accessibility_modifiers=for_non_interface_members:hint 26 | 27 | # ReSharper properties 28 | resharper_autodetect_indent_settings=true 29 | resharper_blank_lines_after_control_transfer_statements=1 30 | resharper_blank_lines_after_multiline_statements=1 31 | resharper_blank_lines_before_block_statements=1 32 | resharper_blank_lines_before_control_transfer_statements=1 33 | resharper_blank_lines_before_multiline_statements=1 34 | resharper_blank_lines_before_single_line_comment=1 35 | resharper_braces_for_for=required 36 | resharper_braces_for_foreach=required 37 | resharper_braces_for_ifelse=required 38 | resharper_braces_for_while=required 39 | resharper_csharp_blank_lines_inside_region=0 40 | resharper_csharp_keep_blank_lines_in_code=1 41 | resharper_csharp_keep_blank_lines_in_declarations=1 42 | resharper_csharp_wrap_lines=false 43 | resharper_csharp_wrap_multiple_declaration_style=wrap_if_long 44 | resharper_keep_existing_declaration_parens_arrangement=false 45 | resharper_keep_existing_embedded_arrangement=false 46 | resharper_keep_existing_expr_member_arrangement=false 47 | resharper_keep_existing_initializer_arrangement=false 48 | resharper_keep_existing_linebreaks=false 49 | resharper_max_enum_members_on_line=1 50 | resharper_place_attribute_on_same_line=False 51 | resharper_place_constructor_initializer_on_same_line=false 52 | resharper_place_simple_anonymousmethod_on_single_line=false 53 | resharper_place_simple_embedded_statement_on_same_line=False 54 | resharper_place_simple_initializer_on_single_line=false 55 | resharper_place_type_constraints_on_same_line=false 56 | resharper_space_after_logical_not_op=true 57 | resharper_use_indent_from_vs=false 58 | resharper_wrap_array_initializer_style=chop_always 59 | resharper_wrap_for_stmt_header_style=wrap_if_long 60 | resharper_wrap_linq_expressions=chop_always 61 | resharper_wrap_multiple_type_parameter_constraints_style=wrap_if_long 62 | resharper_wrap_object_and_collection_initializer_style=chop_always 63 | 64 | # ReSharper inspection severities 65 | resharper_redundant_base_qualifier_highlighting=warning 66 | resharper_web_config_module_not_resolved_highlighting=warning 67 | resharper_web_config_type_not_resolved_highlighting=warning 68 | resharper_web_config_wrong_module_highlighting=warning 69 | 70 | [*.{appxmanifest,asax,ascx,aspx,build,cs,cshtml,dtd,master,nuspec,razor,resw,resx,skin,vb,xaml,xamlx,xoml,xsd}] 71 | indent_style=space 72 | indent_size=4 73 | tab_width=4 74 | -------------------------------------------------------------------------------- /Parser/ParsedNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text.RegularExpressions; 5 | using JollySamurai.UnrealEngine4.T3D.Exception; 6 | 7 | namespace JollySamurai.UnrealEngine4.T3D.Parser 8 | { 9 | public class ParsedNode 10 | { 11 | public string SectionType { get; } 12 | public ParsedNodeBag Children { get; } 13 | public ParsedPropertyBag AttributeBag { get; } 14 | public ParsedPropertyBag PropertyBag { get; } 15 | 16 | public ParsedNode(string sectionType, ParsedNodeBag children, ParsedPropertyBag attributeBag, ParsedPropertyBag propertyBag) 17 | { 18 | SectionType = sectionType; 19 | Children = children; 20 | AttributeBag = attributeBag; 21 | PropertyBag = ConvertArrays(propertyBag); 22 | } 23 | 24 | public ParsedProperty FindAttribute(string name) 25 | { 26 | return AttributeBag.FindProperty(name); 27 | } 28 | 29 | public string FindAttributeValue(string name) 30 | { 31 | return AttributeBag.FindPropertyValue(name); 32 | } 33 | 34 | public ParsedProperty FindProperty(string name) 35 | { 36 | return PropertyBag.FindProperty(name); 37 | } 38 | 39 | public string FindPropertyValue(string name) 40 | { 41 | return PropertyBag.FindPropertyValue(name); 42 | } 43 | 44 | public bool HasAttribute(string name) 45 | { 46 | return AttributeBag.HasProperty(name); 47 | } 48 | 49 | public bool HasProperty(string name) 50 | { 51 | return PropertyBag.HasProperty(name); 52 | } 53 | 54 | private ParsedPropertyBag ConvertArrays(ParsedPropertyBag propertyBag) 55 | { 56 | Dictionary> arrayElements = new Dictionary>(); 57 | Dictionary properties = new Dictionary(); 58 | 59 | foreach (ParsedProperty property in propertyBag.Properties) { 60 | Match arrayCheckResult = ParsedProperty.ArrayRegex.Match(property.Name); 61 | 62 | if (arrayCheckResult.Success) { 63 | string arrayName = arrayCheckResult.Groups[1].Value; 64 | string elementName = arrayCheckResult.Groups[2].Value; 65 | 66 | if (properties.ContainsKey(arrayName)) { 67 | throw new ParserException("Found an array element but there is a non-array version of the property registered", -1, -1); 68 | } 69 | 70 | if (! arrayElements.ContainsKey(arrayName)) { 71 | arrayElements.Add(arrayName, new List()); 72 | } 73 | 74 | arrayElements[arrayName].Add(new ParsedProperty(elementName, property.Value)); 75 | } else { 76 | if (arrayElements.ContainsKey(property.Name)) { 77 | throw new ParserException("Found a normal element but there is an array version of the property registered", -1, -1); 78 | } 79 | 80 | properties.Add(property.Name, property); 81 | } 82 | } 83 | 84 | foreach (var keyValuePair in arrayElements) { 85 | properties.Add(keyValuePair.Key, new ParsedProperty(keyValuePair.Key, keyValuePair.Value.ToArray())); 86 | } 87 | 88 | return new ParsedPropertyBag(properties.Values.ToArray()); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Common.cs: -------------------------------------------------------------------------------- 1 | namespace JollySamurai.UnrealEngine4.T3D 2 | { 3 | public enum RayTracingGlobalIlluminationType 4 | { 5 | Unknown, 6 | Disabled, 7 | BruteForce, 8 | FinalGather 9 | } 10 | 11 | public enum ReflectionsType 12 | { 13 | Unknown, 14 | ScreenSpace, 15 | RayTracing 16 | } 17 | 18 | public enum RayTracingShadows 19 | { 20 | Unknown, 21 | HardShadows, 22 | AreaShadows, 23 | Disabled 24 | } 25 | 26 | public enum TranslucencyType 27 | { 28 | Unknown, 29 | RayTracing, 30 | Raster 31 | } 32 | 33 | public enum BloomMethod 34 | { 35 | Unknown, 36 | SumOfGuassian, 37 | FastFourierTransform 38 | } 39 | 40 | public enum AutoExposureMethod 41 | { 42 | Unknown, 43 | Histogram, 44 | Basic, 45 | Manual 46 | } 47 | 48 | public enum TemperatureType 49 | { 50 | Unknown, 51 | WhiteBalance, 52 | ColorTemperature 53 | } 54 | 55 | public enum SkyLightSourceType 56 | { 57 | Unknown, 58 | CapturedScene, 59 | SpecifiedCubemap 60 | } 61 | 62 | public enum DecalBlendMode 63 | { 64 | Translucent, 65 | Stain, 66 | Normal, 67 | Emissive, 68 | DBufferColorNormalRoughness, 69 | DBufferColor, 70 | DBufferColorNormal, 71 | DBufferColorRoughness, 72 | DBufferNormal, 73 | DBufferNormalRoughness, 74 | DBufferRoughness, 75 | DBufferEmissive, 76 | DBufferAlphaComposite, 77 | DBufferEmissiveAlphaComposite, 78 | VolumetricDistanceFunction, 79 | AlphaComposite, 80 | AmbientOcclusion 81 | } 82 | 83 | public enum WorldPositionIncludedOffsets 84 | { 85 | Default, 86 | ExcludeAllShaderOffsets, 87 | CameraRelative, 88 | CameraRelativeNoOffsets 89 | } 90 | 91 | public enum MaterialSceneAttributeInputMode 92 | { 93 | Coordinates, 94 | OffsetFraction 95 | } 96 | 97 | public enum SceneTextureId 98 | { 99 | SceneColor, 100 | SceneDepth, 101 | DiffuseColor, 102 | SpecularColor, 103 | SubsurfaceColor, 104 | BaseColor, 105 | Specular, 106 | Metallic, 107 | WorldNormal, 108 | SeparateTranslucency, 109 | Opacity, 110 | Roughness, 111 | MaterialAo, 112 | CustomDepth, 113 | PostProcessInput0, 114 | PostProcessInput1, 115 | PostProcessInput2, 116 | PostProcessInput3, 117 | PostProcessInput4, 118 | PostProcessInput5, 119 | PostProcessInput6, 120 | DecalMask, 121 | ShadingModelColor, 122 | ShadingModelId, 123 | AmbientOcclusion, 124 | CustomStencil, 125 | StoredBaseColor, 126 | StoredSpecular, 127 | Velocity, 128 | WorldTangent, 129 | Anisotropy, 130 | } 131 | 132 | public enum LandscapeLayerBlendType 133 | { 134 | WeightBlend, 135 | AlphaBlend, 136 | HeightBlend 137 | } 138 | 139 | public enum MaterialVectorCoordTransformSource 140 | { 141 | Tangent, 142 | Local, 143 | World, 144 | View, 145 | Camera, 146 | ParticleWorld 147 | } 148 | 149 | public enum MaterialVectorCoordTransform 150 | { 151 | Tangent, 152 | Local, 153 | World, 154 | View, 155 | Camera, 156 | ParticleWorld 157 | } 158 | 159 | public struct Vector2 160 | { 161 | public float X { get; } 162 | public float Y { get; } 163 | 164 | public Vector2(float x, float y) 165 | { 166 | X = x; 167 | Y = y; 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /Map/DirectionalLightComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class DirectionalLightComponent : BaseComponent, IMobility 7 | { 8 | public float Intensity { get; } 9 | public Vector4 LightColor { get; } 10 | public Mobility Mobility { get; } 11 | public bool CastShadows { get; } 12 | public float SpecularScale { get; } 13 | public float SourceRadius { get; } 14 | public float SourceLength { get; } 15 | public ResourceReference LightFunctionReference { get; } 16 | public float SoftSourceRadius { get; } 17 | 18 | public DirectionalLightComponent(string name, ResourceReference archetype, Vector3 relativeLocation, Rotator relativeRotation, Vector3 relativeScale3D, Node[] children, float intensity, Vector4 lightColor, Mobility mobility, bool castShadows, float specularScale, float softSourceRadius, float sourceRadius, float sourceLength, ResourceReference lightFunctionReference) 19 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 20 | { 21 | Intensity = intensity; 22 | LightColor = lightColor; 23 | Mobility = mobility; 24 | CastShadows = castShadows; 25 | SpecularScale = specularScale; 26 | SourceRadius = sourceRadius; 27 | SourceLength = sourceLength; 28 | SoftSourceRadius = softSourceRadius; 29 | LightFunctionReference = lightFunctionReference; 30 | } 31 | } 32 | 33 | public class DirectionalLightComponentProcessor : BaseComponentProcessor 34 | { 35 | public override string Class => "/Script/Engine.DirectionalLightComponent"; 36 | 37 | public DirectionalLightComponentProcessor() 38 | { 39 | AddOptionalProperty("CastShadows", PropertyDataType.Boolean); 40 | AddOptionalProperty("Intensity", PropertyDataType.Float); 41 | AddOptionalProperty("LightColor", PropertyDataType.Vector4); 42 | AddOptionalProperty("LightFunctionMaterial", PropertyDataType.ResourceReference); 43 | AddOptionalProperty("Mobility", PropertyDataType.Mobility); 44 | AddOptionalProperty("SpecularScale", PropertyDataType.Float); 45 | AddOptionalProperty("SoftSourceRadius", PropertyDataType.Float); 46 | AddOptionalProperty("SourceRadius", PropertyDataType.Float); 47 | AddOptionalProperty("SourceLength", PropertyDataType.Float); 48 | 49 | AddIgnoredProperty("LightGuid"); 50 | } 51 | 52 | public override Node Convert(ParsedNode node, Node[] children) 53 | { 54 | return new DirectionalLightComponent( 55 | node.FindAttributeValue("Name"), 56 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 57 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 58 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 59 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 60 | children, 61 | ValueUtil.ParseFloat(node.FindPropertyValue("Intensity") ?? "5000.0"), 62 | ValueUtil.ParseVector4(node.FindPropertyValue("LightColor") ?? "(R=255,G=255,B=255,A=255)"), 63 | ValueUtil.ParseMobility(node.FindPropertyValue("Mobility")), 64 | ValueUtil.ParseBoolean(node.FindPropertyValue("CastShadows") ?? "True"), 65 | ValueUtil.ParseFloat(node.FindPropertyValue("SpecularScale") ?? "1.0"), 66 | ValueUtil.ParseFloat(node.FindPropertyValue("SoftSourceRadius")), 67 | ValueUtil.ParseFloat(node.FindPropertyValue("SourceRadius")), 68 | ValueUtil.ParseFloat(node.FindPropertyValue("SourceLength")), 69 | ValueUtil.ParseResourceReference(node.FindPropertyValue("LightFunctionMaterial")) 70 | ); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Map/PointLightComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class PointLightComponent : BaseComponent, IMobility 7 | { 8 | public float AttenuationRadius { get; } 9 | public float Intensity { get; } 10 | public Vector4 LightColor { get; } 11 | public Mobility Mobility { get; } 12 | public bool CastShadows { get; } 13 | public float SpecularScale { get; } 14 | public float SourceRadius { get; } 15 | public float SourceLength { get; } 16 | public ResourceReference LightFunctionReference { get; } 17 | public float SoftSourceRadius { get; } 18 | 19 | public PointLightComponent(string name, ResourceReference archetype, Vector3 relativeLocation, Rotator relativeRotation, Vector3 relativeScale3D, Node[] children, float attenuationRadius, float intensity, Vector4 lightColor, Mobility mobility, bool castShadows, float specularScale, float softSourceRadius, float sourceRadius, float sourceLength, ResourceReference lightFunctionReference) 20 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 21 | { 22 | AttenuationRadius = attenuationRadius; 23 | Intensity = intensity; 24 | LightColor = lightColor; 25 | Mobility = mobility; 26 | CastShadows = castShadows; 27 | SpecularScale = specularScale; 28 | SourceRadius = sourceRadius; 29 | SourceLength = sourceLength; 30 | SoftSourceRadius = softSourceRadius; 31 | LightFunctionReference = lightFunctionReference; 32 | } 33 | } 34 | 35 | public class PointLightComponentProcessor : BaseComponentProcessor 36 | { 37 | public override string Class => "/Script/Engine.PointLightComponent"; 38 | 39 | public PointLightComponentProcessor() 40 | { 41 | AddOptionalProperty("AttenuationRadius", PropertyDataType.Float); 42 | AddOptionalProperty("CastShadows", PropertyDataType.Boolean); 43 | AddOptionalProperty("Intensity", PropertyDataType.Float); 44 | AddOptionalProperty("LightColor", PropertyDataType.Vector4); 45 | AddOptionalProperty("LightFunctionMaterial", PropertyDataType.ResourceReference); 46 | AddOptionalProperty("Mobility", PropertyDataType.Mobility); 47 | AddOptionalProperty("SpecularScale", PropertyDataType.Float); 48 | AddOptionalProperty("SoftSourceRadius", PropertyDataType.Float); 49 | AddOptionalProperty("SourceRadius", PropertyDataType.Float); 50 | AddOptionalProperty("SourceLength", PropertyDataType.Float); 51 | 52 | AddIgnoredProperty("LightGuid"); 53 | } 54 | 55 | public override Node Convert(ParsedNode node, Node[] children) 56 | { 57 | return new PointLightComponent( 58 | node.FindAttributeValue("Name"), 59 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 60 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 61 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 62 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 63 | children, 64 | ValueUtil.ParseFloat(node.FindPropertyValue("AttenuationRadius") ?? "1000.0"), 65 | ValueUtil.ParseFloat(node.FindPropertyValue("Intensity") ?? "5000.0"), 66 | ValueUtil.ParseVector4(node.FindPropertyValue("LightColor") ?? "(R=255,G=255,B=255,A=255)"), 67 | ValueUtil.ParseMobility(node.FindPropertyValue("Mobility")), 68 | ValueUtil.ParseBoolean(node.FindPropertyValue("CastShadows") ?? "True"), 69 | ValueUtil.ParseFloat(node.FindPropertyValue("SpecularScale") ?? "1.0"), 70 | ValueUtil.ParseFloat(node.FindPropertyValue("SoftSourceRadius")), 71 | ValueUtil.ParseFloat(node.FindPropertyValue("SourceRadius")), 72 | ValueUtil.ParseFloat(node.FindPropertyValue("SourceLength")), 73 | ValueUtil.ParseResourceReference(node.FindPropertyValue("LightFunctionMaterial")) 74 | ); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Map/SpotLightComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class SpotLightComponent : BaseComponent, IMobility 7 | { 8 | public float AttenuationRadius { get; } 9 | public float Intensity { get; } 10 | public Vector4 LightColor { get; } 11 | public Mobility Mobility { get; } 12 | public bool CastShadows { get; } 13 | public float SpecularScale { get; } 14 | public float SoftSourceRadius { get; } 15 | public float SourceRadius { get; } 16 | public float SourceLength { get; } 17 | public float InnerConeAngle { get; } 18 | public float OuterConeAngle { get; } 19 | public ResourceReference LightFunctionReference { get; } 20 | 21 | public SpotLightComponent(string name, ResourceReference archetype, Vector3 relativeLocation, Rotator relativeRotation, Vector3 relativeScale3D, Node[] children, float attenuationRadius, float intensity, Vector4 lightColor, Mobility mobility, bool castShadows, float specularScale, float softSourceRadius, float sourceRadius, float sourceLength, float innerConeAngle, float outerConeAngle, ResourceReference lightFunctionReference) 22 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 23 | { 24 | AttenuationRadius = attenuationRadius; 25 | Intensity = intensity; 26 | LightColor = lightColor; 27 | Mobility = mobility; 28 | CastShadows = castShadows; 29 | SpecularScale = specularScale; 30 | SoftSourceRadius = softSourceRadius; 31 | SourceRadius = sourceRadius; 32 | SourceLength = sourceLength; 33 | InnerConeAngle = innerConeAngle; 34 | OuterConeAngle = outerConeAngle; 35 | LightFunctionReference = lightFunctionReference; 36 | } 37 | } 38 | 39 | public class SpotLightComponentProcessor : BaseComponentProcessor 40 | { 41 | public override string Class => "/Script/Engine.SpotLightComponent"; 42 | 43 | public SpotLightComponentProcessor() 44 | { 45 | AddOptionalProperty("AttenuationRadius", PropertyDataType.Float); 46 | AddOptionalProperty("CastShadows", PropertyDataType.Boolean); 47 | AddOptionalProperty("InnerConeAngle", PropertyDataType.Float); 48 | AddOptionalProperty("Intensity", PropertyDataType.Float); 49 | AddOptionalProperty("LightColor", PropertyDataType.Vector4); 50 | AddOptionalProperty("LightFunctionMaterial", PropertyDataType.ResourceReference); 51 | AddOptionalProperty("Mobility", PropertyDataType.Mobility); 52 | AddOptionalProperty("OuterConeAngle", PropertyDataType.Float); 53 | AddOptionalProperty("SpecularScale", PropertyDataType.Float); 54 | AddOptionalProperty("SoftSourceRadius", PropertyDataType.Float); 55 | AddOptionalProperty("SourceRadius", PropertyDataType.Float); 56 | AddOptionalProperty("SourceLength", PropertyDataType.Float); 57 | 58 | AddIgnoredProperty("LightGuid"); 59 | } 60 | 61 | public override Node Convert(ParsedNode node, Node[] children) 62 | { 63 | return new SpotLightComponent( 64 | node.FindAttributeValue("Name"), 65 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 66 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 67 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 68 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 69 | children, 70 | ValueUtil.ParseFloat(node.FindPropertyValue("AttenuationRadius") ?? "1000.0"), 71 | ValueUtil.ParseFloat(node.FindPropertyValue("Intensity") ?? "5000.0"), 72 | ValueUtil.ParseVector4(node.FindPropertyValue("LightColor") ?? "(R=255,G=255,B=255,A=255)"), 73 | ValueUtil.ParseMobility(node.FindPropertyValue("Mobility")), 74 | ValueUtil.ParseBoolean(node.FindPropertyValue("CastShadows") ?? "True"), 75 | ValueUtil.ParseFloat(node.FindPropertyValue("SpecularScale") ?? "1.0"), 76 | ValueUtil.ParseFloat(node.FindPropertyValue("SoftSourceRadius")), 77 | ValueUtil.ParseFloat(node.FindPropertyValue("SourceRadius")), 78 | ValueUtil.ParseFloat(node.FindPropertyValue("SourceLength")), 79 | ValueUtil.ParseFloat(node.FindPropertyValue("InnerConeAngle")), 80 | ValueUtil.ParseFloat(node.FindPropertyValue("OuterConeAngle") ?? "44.0"), 81 | ValueUtil.ParseResourceReference(node.FindPropertyValue("LightFunctionMaterial")) 82 | ); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Material/MaterialDocumentProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JollySamurai.UnrealEngine4.T3D.Parser; 3 | using JollySamurai.UnrealEngine4.T3D.Processor; 4 | 5 | namespace JollySamurai.UnrealEngine4.T3D.Material 6 | { 7 | public class MaterialDocumentProcessor : DocumentProcessor 8 | { 9 | private readonly string[] IgnoredNodes = { 10 | "/Script/UnrealEd.SceneThumbnailInfoWithPrimitive", 11 | }; 12 | 13 | public MaterialDocumentProcessor() 14 | { 15 | AddNodeProcessor(new MaterialProcessor()); 16 | AddNodeProcessor(new MaterialExpressionAbsProcessor()); 17 | AddNodeProcessor(new MaterialExpressionAddProcessor()); 18 | AddNodeProcessor(new MaterialExpressionAppendVectorProcessor()); 19 | AddNodeProcessor(new MaterialExpressionCameraPositionWSProcessor()); 20 | AddNodeProcessor(new MaterialExpressionClampProcessor()); 21 | AddNodeProcessor(new MaterialExpressionCommentProcessor()); 22 | AddNodeProcessor(new MaterialExpressionComponentMaskProcessor()); 23 | AddNodeProcessor(new MaterialExpressionConstantProcessor()); 24 | AddNodeProcessor(new MaterialExpressionConstant2VectorProcessor()); 25 | AddNodeProcessor(new MaterialExpressionConstant3VectorProcessor()); 26 | AddNodeProcessor(new MaterialExpressionConstant4VectorProcessor()); 27 | AddNodeProcessor(new MaterialExpressionCrossProductProcessor()); 28 | AddNodeProcessor(new MaterialExpressionDDXProcessor()); 29 | AddNodeProcessor(new MaterialExpressionDDYProcessor()); 30 | AddNodeProcessor(new MaterialExpressionDepthFadeProcessor()); 31 | AddNodeProcessor(new MaterialExpressionDesaturationProcessor()); 32 | AddNodeProcessor(new MaterialExpressionDistanceProcessor()); 33 | AddNodeProcessor(new MaterialExpressionDivideProcessor()); 34 | AddNodeProcessor(new MaterialExpressionDotProductProcessor()); 35 | AddNodeProcessor(new MaterialExpressionFloorProcessor()); 36 | AddNodeProcessor(new MaterialExpressionFracProcessor()); 37 | AddNodeProcessor(new MaterialExpressionFresnelProcessor()); 38 | AddNodeProcessor(new MaterialExpressionLinearInterpolateProcessor()); 39 | AddNodeProcessor(new MaterialExpressionObjectFunctionCallProcessor()); 40 | AddNodeProcessor(new MaterialExpressionMultiplyProcessor()); 41 | AddNodeProcessor(new MaterialExpressionNormalizeProcessor()); 42 | AddNodeProcessor(new MaterialExpressionOneMinusProcessor()); 43 | AddNodeProcessor(new MaterialExpressionPannerProcessor()); 44 | AddNodeProcessor(new MaterialExpressionParticleColorProcessor()); 45 | AddNodeProcessor(new MaterialExpressionParticleSizeProcessor()); 46 | AddNodeProcessor(new MaterialExpressionPixelDepthProcessor()); 47 | AddNodeProcessor(new MaterialExpressionPowerProcessor()); 48 | AddNodeProcessor(new MaterialExpressionRotateAboutAxisProcessor()); 49 | AddNodeProcessor(new MaterialExpressionScalarParameterProcessor()); 50 | AddNodeProcessor(new MaterialExpressionSceneDepthProcessor()); 51 | AddNodeProcessor(new MaterialExpressionSceneTextureProcessor()); 52 | AddNodeProcessor(new MaterialExpressionScreenPositionProcessor()); 53 | AddNodeProcessor(new MaterialExpressionSineProcessor()); 54 | AddNodeProcessor(new MaterialExpressionStaticBoolParameterProcessor()); 55 | AddNodeProcessor(new MaterialExpressionStaticSwitchParameterProcessor()); 56 | AddNodeProcessor(new MaterialExpressionStaticSwitchProcessor()); 57 | AddNodeProcessor(new MaterialExpressionSubtractProcessor()); 58 | AddNodeProcessor(new MaterialExpressionTextureCoordinateProcessor()); 59 | AddNodeProcessor(new MaterialExpressionTextureObjectParameterProcessor()); 60 | AddNodeProcessor(new MaterialExpressionTextureObjectProcessor()); 61 | AddNodeProcessor(new MaterialExpressionTextureSampleProcessor()); 62 | AddNodeProcessor(new MaterialExpressionTransformProcessor()); 63 | AddNodeProcessor(new MaterialExpressionTextureSampleParameter2DProcessor()); 64 | AddNodeProcessor(new MaterialExpressionTimeProcessor()); 65 | AddNodeProcessor(new MaterialExpressionVectorParameterProcessor()); 66 | AddNodeProcessor(new MaterialExpressionVertexColorProcessor()); 67 | AddNodeProcessor(new MaterialExpressionVertexNormalWSProcessor()); 68 | AddNodeProcessor(new MaterialExpressionWorldPositionProcessor()); 69 | } 70 | 71 | protected override bool IsIgnoredNode(ParsedNode parsedNode) 72 | { 73 | var nodeClass = parsedNode.AttributeBag.FindProperty("Class")?.Value; 74 | 75 | return IgnoredNodes.Count(s => s == nodeClass) != 0; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Map/ExponentialHeightFogComponent.cs: -------------------------------------------------------------------------------- 1 | using JollySamurai.UnrealEngine4.T3D.Parser; 2 | using JollySamurai.UnrealEngine4.T3D.Processor; 3 | 4 | namespace JollySamurai.UnrealEngine4.T3D.Map 5 | { 6 | public class ExponentialHeightFogComponent : BaseComponent, IMobility 7 | { 8 | public Mobility Mobility { get; } 9 | public float FogDensity { get; } 10 | public float FogHeightFalloff { get; } 11 | public Vector4 FogInscatteringColor { get; } 12 | public ResourceReference InscatteringColorCubemap { get; } 13 | public float InscatteringColorCubemapAngle { get; } 14 | public Vector4 InscatteringTextureTint { get; } 15 | public float FullyDirectionalInscatteringColorDistance { get; } 16 | public float FogMaxOpacity { get; } 17 | public float StartDistance { get; } 18 | public float FogCutoffDistance { get; } 19 | public bool EnableVolumetricFog { get; } 20 | public float VolumetricFogScatteringDistribution { get; } 21 | public Vector4 VolumetricFogAlbedo { get; } 22 | public Vector4 VolumetricFogEmissive { get; } 23 | public float VolumetricFogExtinctionScale { get; } 24 | public float VolumetricFogDistance { get; } 25 | public float VolumetricFogStaticLightingScatteringIntensity { get; } 26 | public bool OverrideLightColorsWithFogInscatteringColors { get; } 27 | 28 | public ExponentialHeightFogComponent( 29 | string name, 30 | ResourceReference archetype, 31 | Vector3 relativeLocation, 32 | Rotator relativeRotation, 33 | Vector3 relativeScale3D, 34 | Node[] children, 35 | Mobility mobility, 36 | float fogDensity, 37 | float fogHeightFalloff, 38 | Vector4 fogInscatteringColor, 39 | ResourceReference inscatteringColorCubemap, 40 | float inscatteringColorCubemapAngle, 41 | Vector4 inscatteringTextureTint, 42 | float fullyDirectionalInscatteringColorDistance, 43 | float fogMaxOpacity, 44 | float startDistance, 45 | float fogCutoffDistance, 46 | bool enableVolumetricFog, 47 | float volumetricFogScatteringDistribution, 48 | Vector4 volumetricFogAlbedo, 49 | Vector4 volumetricFogEmissive, 50 | float volumetricFogExtinctionScale, 51 | float volumetricFogDistance, 52 | float volumetricFogStaticLightingScatteringIntensity, 53 | bool overrideLightColorsWithFogInscatteringColors 54 | ) 55 | : base(name, archetype, relativeLocation, relativeScale3D, relativeRotation, children) 56 | { 57 | Mobility = mobility; 58 | FogDensity = fogDensity; 59 | FogHeightFalloff = fogHeightFalloff; 60 | FogInscatteringColor = fogInscatteringColor; 61 | InscatteringColorCubemap = inscatteringColorCubemap; 62 | InscatteringColorCubemapAngle = inscatteringColorCubemapAngle; 63 | InscatteringTextureTint = inscatteringTextureTint; 64 | FullyDirectionalInscatteringColorDistance = fullyDirectionalInscatteringColorDistance; 65 | FogMaxOpacity = fogMaxOpacity; 66 | StartDistance = startDistance; 67 | FogCutoffDistance = fogCutoffDistance; 68 | EnableVolumetricFog = enableVolumetricFog; 69 | VolumetricFogScatteringDistribution = volumetricFogScatteringDistribution; 70 | VolumetricFogAlbedo = volumetricFogAlbedo; 71 | VolumetricFogEmissive = volumetricFogEmissive; 72 | VolumetricFogExtinctionScale = volumetricFogExtinctionScale; 73 | VolumetricFogDistance = volumetricFogDistance; 74 | VolumetricFogStaticLightingScatteringIntensity = volumetricFogStaticLightingScatteringIntensity; 75 | OverrideLightColorsWithFogInscatteringColors = overrideLightColorsWithFogInscatteringColors; 76 | } 77 | } 78 | 79 | public class ExponentialHeightFogComponentProcessor : BaseComponentProcessor 80 | { 81 | public override string Class => "/Script/Engine.ExponentialHeightFogComponent"; 82 | 83 | public ExponentialHeightFogComponentProcessor() 84 | { 85 | AddOptionalProperty("Mobility", PropertyDataType.Mobility); 86 | AddOptionalProperty("FogDensity", PropertyDataType.Float); 87 | AddOptionalProperty("FogHeightFalloff", PropertyDataType.Float); 88 | AddOptionalProperty("FogInscatteringColor", PropertyDataType.Vector4); 89 | AddOptionalProperty("InscatteringColorCubemap", PropertyDataType.ResourceReference); 90 | AddOptionalProperty("InscatteringColorCubemapAngle", PropertyDataType.Float); 91 | AddOptionalProperty("InscatteringTextureTint", PropertyDataType.Vector4); 92 | AddOptionalProperty("FullyDirectionalInscatteringColorDistance", PropertyDataType.Float); 93 | AddOptionalProperty("FogMaxOpacity", PropertyDataType.Float); 94 | AddOptionalProperty("StartDistance", PropertyDataType.Float); 95 | AddOptionalProperty("FogCutoffDistance", PropertyDataType.Float); 96 | AddOptionalProperty("bEnableVolumetricFog", PropertyDataType.Boolean); 97 | AddOptionalProperty("VolumetricFogScatteringDistribution", PropertyDataType.Float); 98 | AddOptionalProperty("VolumetricFogAlbedo", PropertyDataType.Vector4); 99 | AddOptionalProperty("VolumetricFogEmissive", PropertyDataType.Vector4); 100 | AddOptionalProperty("VolumetricFogExtinctionScale", PropertyDataType.Float); 101 | AddOptionalProperty("VolumetricFogDistance", PropertyDataType.Float); 102 | AddOptionalProperty("VolumetricFogStaticLightingScatteringIntensity", PropertyDataType.Float); 103 | AddOptionalProperty("bOverrideLightColorsWithFogInscatteringColors", PropertyDataType.Boolean); 104 | 105 | AddIgnoredProperty("LightGuid"); 106 | } 107 | 108 | public override Node Convert(ParsedNode node, Node[] children) 109 | { 110 | return new ExponentialHeightFogComponent( 111 | node.FindAttributeValue("Name"), 112 | ValueUtil.ParseResourceReference(node.FindAttributeValue("Archetype")), 113 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeLocation")), 114 | ValueUtil.ParseRotator(node.FindPropertyValue("RelativeRotation")), 115 | ValueUtil.ParseVector3(node.FindPropertyValue("RelativeScale3D") ?? "(X=1.0,Y=1.0,Z=1.0)"), 116 | children, 117 | ValueUtil.ParseMobility(node.FindPropertyValue("Mobility")), 118 | ValueUtil.ParseFloat(node.FindPropertyValue("FogDensity") ?? "0.02"), 119 | ValueUtil.ParseFloat(node.FindPropertyValue("FogHeightFalloff") ?? "0.2"), 120 | ValueUtil.ParseVector4(node.FindPropertyValue("FogInscatteringColor") ?? "(R=0.447,G=0.638,B=1.0,A=1.0)"), 121 | ValueUtil.ParseResourceReference(node.FindPropertyValue("InscatteringColorCubemap")), 122 | ValueUtil.ParseFloat(node.FindPropertyValue("InscatteringColorCubemapAngle")), 123 | ValueUtil.ParseVector4(node.FindPropertyValue("InscatteringTextureTint") ?? "(R=1.354348,G=1.0,B=1.0,A=1.0)"), 124 | ValueUtil.ParseFloat(node.FindPropertyValue("FullyDirectionalInscatteringColorDistance") ?? "670857.125"), 125 | ValueUtil.ParseFloat(node.FindPropertyValue("FogMaxOpacity") ?? "1.0"), 126 | ValueUtil.ParseFloat(node.FindPropertyValue("StartDistance")), 127 | ValueUtil.ParseFloat(node.FindPropertyValue("FogCutoffDistance")), 128 | ValueUtil.ParseBoolean(node.FindPropertyValue("bEnableVolumetricFog")), 129 | ValueUtil.ParseFloat(node.FindPropertyValue("VolumetricFogScatteringDistribution") ?? "0.2"), 130 | ValueUtil.ParseVector4(node.FindPropertyValue("VolumetricFogAlbedo") ?? "(R=255,G=255,B=255,A=255)"), 131 | ValueUtil.ParseVector4(node.FindPropertyValue("VolumetricFogEmissive")), 132 | ValueUtil.ParseFloat(node.FindPropertyValue("VolumetricFogExtinctionScale") ?? "1.0"), 133 | ValueUtil.ParseFloat(node.FindPropertyValue("VolumetricFogDistance") ?? "6000.0"), 134 | ValueUtil.ParseFloat(node.FindPropertyValue("VolumetricFogStaticLightingScatteringIntensity") ?? "1.0"), 135 | ValueUtil.ParseBoolean(node.FindPropertyValue("bOverrideLightColorsWithFogInscatteringColors")) 136 | ); 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /JollySamurai.UnrealEngine4.T3D.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {BB5D3C25-B20E-4426-B696-31FD17AE0102} 8 | Library 9 | Properties 10 | JollySamurai.UnrealEngine4.T3D 11 | JollySamurai.UnrealEngine4.T3D 12 | v4.7.2 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 173 | --------------------------------------------------------------------------------