mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Def load selection and basic def alteration
This commit is contained in:
parent
f78d85de3b
commit
0364322d46
311 changed files with 15823 additions and 1151 deletions
|
@ -7,19 +7,31 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class Actor
|
||||
{
|
||||
public List<string> defNames = new List<string>();
|
||||
public List<string> requiredGenitals = new List<string>();
|
||||
public bool controlGenitalAngle = false;
|
||||
public List<AlienRaceOffset> raceOffsets;
|
||||
public List<string> blacklistedRaces;
|
||||
public bool initiator = false;
|
||||
[XmlArray("defNames"), XmlArrayItem("li")] public List<string> defNames = new List<string>();
|
||||
[XmlArray("bodyDefTypes"), XmlArrayItem("li")] public List<string> bodyDefTypes = new List<string>();
|
||||
[XmlArray("requiredGender"), XmlArrayItem("li")] public List<string> requiredGender = new List<string>();
|
||||
[XmlArray("requiredGenitals"), XmlArrayItem("li")] public List<string> requiredGenitals = new List<string>();
|
||||
[XmlArray("raceOffsets"), XmlArrayItem("li")] public List<AlienRaceOffset> raceOffsets = new List<AlienRaceOffset>();
|
||||
[XmlArray("blacklistedRaces"), XmlArrayItem("li")] public List<string> blacklistedRaces = new List<string>();
|
||||
[XmlArray("tags"), XmlArrayItem("li")] public List<string> tags;
|
||||
|
||||
public string gender;
|
||||
public bool isFucking = false;
|
||||
public bool isFucked = false;
|
||||
public List<string> bodyDefTypes = new List<string>();
|
||||
public BodyTypeOffset bodyTypeOffset = new BodyTypeOffset();
|
||||
public Vector3 offset = new Vector2(0, 0);
|
||||
public List<string> requiredGender;
|
||||
public List<string> tags = new List<string>();
|
||||
public bool initiator = false;
|
||||
public bool? controlGenitalAngle;
|
||||
public bool? isFucking;
|
||||
public bool? isFucked;
|
||||
|
||||
public bool ShouldSerializedefNames() { return defNames.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializebodyDefTypes() { return bodyDefTypes.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializerequiredGender() { return requiredGender.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializerequiredGenitals() { return requiredGenitals.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializeraceOffsets() { return raceOffsets.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializeblacklistedRaces() { return blacklistedRaces.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializetags() { return tags.NotNullOrEmpty(); }
|
||||
|
||||
public bool ShouldSerializecontrolGenitalAngle() { return controlGenitalAngle != null; }
|
||||
public bool ShouldSerializeisFucking() { return isFucking != null; }
|
||||
public bool ShouldSerializeisFucked() { return isFucked != null; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,13 +6,14 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public abstract class AnimationClip
|
||||
{
|
||||
[XmlIgnore]
|
||||
public Dictionary<int, string> SoundEffects = new Dictionary<int, string>();
|
||||
public List<string> types;
|
||||
public int duration;
|
||||
public string layer = "Pawn";
|
||||
public List<string> tags;
|
||||
|
||||
[XmlIgnore] public int duration;
|
||||
[XmlIgnore] public Dictionary<int, string> SoundEffects = new Dictionary<int, string>();
|
||||
|
||||
public abstract void BuildSimpleCurves();
|
||||
public string soundDef = null;
|
||||
public int actor;
|
||||
public List<string> tags = new List<string>();
|
||||
|
||||
public bool ShouldSerializetags() { return tags.NotNullOrEmpty(); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,10 +7,7 @@ namespace RimWorldAnimationStudio
|
|||
public class PawnAnimationClip : AnimationClip
|
||||
{
|
||||
[XmlAttribute("Class")] public string className = "Rimworld_Animations.PawnAnimationClip";
|
||||
|
||||
[XmlArray("keyframes"), XmlArrayItem("li")] public List<PawnKeyframe> keyframes = new List<PawnKeyframe>();
|
||||
|
||||
public AltitudeLayer layer = AltitudeLayer.Pawn;
|
||||
|
||||
[XmlIgnore] public Dictionary<int, bool> quiver = new Dictionary<int, bool>();
|
||||
[XmlIgnore] public SimpleCurve GenitalAngle = new SimpleCurve();
|
||||
|
@ -36,70 +33,39 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
if (frame.atTick.HasValue)
|
||||
{
|
||||
if (frame.bodyAngle.HasValue)
|
||||
BodyAngle.Add((float)frame.atTick / (float)duration, frame.bodyAngle.Value, true);
|
||||
|
||||
if (frame.headAngle.HasValue)
|
||||
HeadAngle.Add((float)frame.atTick / (float)duration, frame.headAngle.Value, true);
|
||||
|
||||
if (frame.bodyOffsetX.HasValue)
|
||||
BodyOffsetX.Add((float)frame.atTick / (float)duration, frame.bodyOffsetX.Value, true);
|
||||
|
||||
if (frame.bodyOffsetZ.HasValue)
|
||||
BodyOffsetZ.Add((float)frame.atTick / (float)duration, frame.bodyOffsetZ.Value, true);
|
||||
|
||||
if (frame.headFacing.HasValue)
|
||||
HeadFacing.Add((float)frame.atTick / (float)duration, frame.headFacing.Value, true);
|
||||
|
||||
if (frame.bodyFacing.HasValue)
|
||||
BodyFacing.Add((float)frame.atTick / (float)duration, frame.bodyFacing.Value, true);
|
||||
|
||||
if (frame.headBob.HasValue)
|
||||
HeadBob.Add((float)frame.atTick / (float)duration, frame.headBob.Value, true);
|
||||
BodyAngle.Add((float)frame.atTick / (float)duration, frame.bodyAngle, true);
|
||||
HeadAngle.Add((float)frame.atTick / (float)duration, frame.headAngle, true);
|
||||
BodyOffsetX.Add((float)frame.atTick / (float)duration, frame.bodyOffsetX, true);
|
||||
BodyOffsetZ.Add((float)frame.atTick / (float)duration, frame.bodyOffsetZ, true);
|
||||
HeadFacing.Add((float)frame.atTick / (float)duration, frame.headFacing, true);
|
||||
BodyFacing.Add((float)frame.atTick / (float)duration, frame.bodyFacing, true);
|
||||
HeadBob.Add((float)frame.atTick / (float)duration, frame.headBob, true);
|
||||
|
||||
if (frame.genitalAngle.HasValue)
|
||||
GenitalAngle.Add((float)frame.atTick / (float)duration, frame.genitalAngle.Value, true);
|
||||
{ GenitalAngle.Add((float)frame.atTick / (float)duration, frame.genitalAngle.Value, true); }
|
||||
|
||||
if (frame.soundEffect != null)
|
||||
{
|
||||
SoundEffects.Add((int)frame.atTick, frame.soundEffect);
|
||||
}
|
||||
{ SoundEffects.Add((int)frame.atTick, frame.soundEffect); }
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (frame.bodyAngle.HasValue)
|
||||
BodyAngle.Add((float)keyframePosition / (float)duration, frame.bodyAngle.Value, true);
|
||||
|
||||
if (frame.headAngle.HasValue)
|
||||
HeadAngle.Add((float)keyframePosition / (float)duration, frame.headAngle.Value, true);
|
||||
|
||||
if (frame.bodyOffsetX.HasValue)
|
||||
BodyOffsetX.Add((float)keyframePosition / (float)duration, frame.bodyOffsetX.Value, true);
|
||||
|
||||
if (frame.bodyOffsetZ.HasValue)
|
||||
BodyOffsetZ.Add((float)keyframePosition / (float)duration, frame.bodyOffsetZ.Value, true);
|
||||
|
||||
if (frame.headFacing.HasValue)
|
||||
HeadFacing.Add((float)keyframePosition / (float)duration, frame.headFacing.Value, true);
|
||||
|
||||
if (frame.bodyFacing.HasValue)
|
||||
BodyFacing.Add((float)keyframePosition / (float)duration, frame.bodyFacing.Value, true);
|
||||
|
||||
if (frame.headBob.HasValue)
|
||||
HeadBob.Add((float)keyframePosition / (float)duration, frame.headBob.Value, true);
|
||||
BodyAngle.Add((float)keyframePosition / (float)duration, frame.bodyAngle, true);
|
||||
HeadAngle.Add((float)keyframePosition / (float)duration, frame.headAngle, true);
|
||||
BodyOffsetX.Add((float)keyframePosition / (float)duration, frame.bodyOffsetX, true);
|
||||
BodyOffsetZ.Add((float)keyframePosition / (float)duration, frame.bodyOffsetZ, true);
|
||||
HeadFacing.Add((float)keyframePosition / (float)duration, frame.headFacing, true);
|
||||
BodyFacing.Add((float)keyframePosition / (float)duration, frame.bodyFacing, true);
|
||||
HeadBob.Add((float)keyframePosition / (float)duration, frame.headBob, true);
|
||||
|
||||
if (frame.genitalAngle.HasValue)
|
||||
GenitalAngle.Add((float)keyframePosition / (float)duration, frame.genitalAngle.Value, true);
|
||||
|
||||
if (frame.soundEffect != null)
|
||||
{
|
||||
SoundEffects.Add(keyframePosition, frame.soundEffect);
|
||||
}
|
||||
{ SoundEffects.Add(keyframePosition, frame.soundEffect); }
|
||||
|
||||
if (frame.tickDuration != 1 && frame.quiver.HasValue)
|
||||
{
|
||||
|
||||
quiver.Add(keyframePosition, true);
|
||||
quiver.Add(keyframePosition + frame.tickDuration - 1, false);
|
||||
}
|
||||
|
|
|
@ -6,10 +6,8 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class ThingAnimationClip : AnimationClip
|
||||
{
|
||||
[XmlAttribute("Class")] public string className = "Rimworld_Animations.PawnAnimationClip";
|
||||
|
||||
[XmlAttribute("Class")] public string className = "Rimworld_Animations.ThingAnimationClip";
|
||||
[XmlArray("keyframes"), XmlArrayItem("li")] public List<ThingKeyframe> keyframes = new List<ThingKeyframe>();
|
||||
public string layer = "Pawn";
|
||||
|
||||
[XmlIgnore] public SimpleCurve PositionX = new SimpleCurve();
|
||||
[XmlIgnore] public SimpleCurve PositionZ = new SimpleCurve();
|
||||
|
@ -32,36 +30,22 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
if (frame.atTick.HasValue)
|
||||
{
|
||||
if (frame.positionX.HasValue)
|
||||
PositionX.Add((float)frame.atTick / (float)duration, frame.positionX.Value, true);
|
||||
|
||||
if (frame.positionZ.HasValue)
|
||||
PositionZ.Add((float)frame.atTick / (float)duration, frame.positionZ.Value, true);
|
||||
|
||||
if (frame.rotation.HasValue)
|
||||
Rotation.Add((float)frame.atTick / (float)duration, frame.rotation.Value, true);
|
||||
PositionX.Add((float)frame.atTick / (float)duration, frame.positionX, true);
|
||||
PositionZ.Add((float)frame.atTick / (float)duration, frame.positionZ, true);
|
||||
Rotation.Add((float)frame.atTick / (float)duration, frame.rotation, true);
|
||||
|
||||
if (frame.soundEffect != null)
|
||||
{
|
||||
SoundEffects.Add((int)frame.atTick, frame.soundEffect);
|
||||
}
|
||||
{ SoundEffects.Add((int)frame.atTick, frame.soundEffect); }
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (frame.positionX.HasValue)
|
||||
PositionX.Add((float)keyframePosition / (float)duration, frame.positionX.Value, true);
|
||||
|
||||
if (frame.positionZ.HasValue)
|
||||
PositionZ.Add((float)keyframePosition / (float)duration, frame.positionZ.Value, true);
|
||||
|
||||
if (frame.rotation.HasValue)
|
||||
Rotation.Add((float)keyframePosition / (float)duration, frame.rotation.Value, true);
|
||||
PositionX.Add((float)keyframePosition / (float)duration, frame.positionX, true);
|
||||
PositionZ.Add((float)keyframePosition / (float)duration, frame.positionZ, true);
|
||||
Rotation.Add((float)keyframePosition / (float)duration, frame.rotation, true);
|
||||
|
||||
if (frame.soundEffect != null)
|
||||
{
|
||||
SoundEffects.Add(keyframePosition, frame.soundEffect);
|
||||
}
|
||||
{ SoundEffects.Add(keyframePosition, frame.soundEffect); }
|
||||
|
||||
keyframePosition += frame.tickDuration;
|
||||
}
|
||||
|
|
|
@ -9,12 +9,14 @@ namespace RimWorldAnimationStudio
|
|||
public string defName = "Undefined";
|
||||
public string label = "Undefined";
|
||||
public bool sounds = false;
|
||||
[XmlIgnore] public int animationTimeTicks = 0;
|
||||
|
||||
[XmlArray("sexTypes"), XmlArrayItem("li")] public List<string> sexTypes = new List<string>();
|
||||
[XmlArray("interactionDefTypes"), XmlArrayItem("li")] public List<string> interactionDefTypes = new List<string>();
|
||||
[XmlArray("actors"), XmlArrayItem("li")] public List<Actor> actors = new List<Actor>();
|
||||
[XmlArray("animationStages"), XmlArrayItem("li")] public List<AnimationStage> animationStages = new List<AnimationStage>();
|
||||
|
||||
[XmlIgnore] public int animationTimeTicks = 0;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
animationTimeTicks = 0;
|
||||
|
|
|
@ -12,20 +12,19 @@ namespace RimWorldAnimationStudio
|
|||
public string Hulk;
|
||||
public string Fat;
|
||||
|
||||
public void SetOffset(string bodyType, Vector2 offset)
|
||||
public void SetOffset(string bodyType, Vector2 bodyOffset)
|
||||
{
|
||||
FieldInfo bodyTypeOffsetInfo = typeof(BodyTypeOffset).GetField(bodyType);
|
||||
|
||||
if (bodyTypeOffsetInfo == null)
|
||||
{ return; }
|
||||
|
||||
bodyTypeOffsetInfo.SetValue(this, offset.ToString());
|
||||
string _bodyOffset = "(" + bodyOffset.x + ", " + bodyOffset.y + ")";
|
||||
bodyTypeOffsetInfo.SetValue(this, _bodyOffset);
|
||||
}
|
||||
|
||||
public Vector3 GetOffset(string bodyType)
|
||||
{
|
||||
Debug.Log(bodyType);
|
||||
|
||||
FieldInfo bodyTypeOffsetInfo = typeof(BodyTypeOffset).GetField(bodyType);
|
||||
|
||||
if (bodyTypeOffsetInfo == null)
|
||||
|
|
|
@ -6,9 +6,13 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class Keyframe
|
||||
{
|
||||
public int tickDuration = 1;
|
||||
public float? atTick;
|
||||
|
||||
public int tickDuration = 1;
|
||||
public string soundEffect;
|
||||
public List<string> tags = new List<string>();
|
||||
|
||||
public bool ShouldSerializeatTick() { return atTick != null; }
|
||||
public bool ShouldSerializetags() { return tags.NotNullOrEmpty(); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,18 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class PawnKeyframe : Keyframe
|
||||
{
|
||||
public float? bodyAngle;
|
||||
public float? headAngle;
|
||||
public float? headBob;
|
||||
public float? bodyOffsetX;
|
||||
public float? bodyOffsetZ;
|
||||
public float? headFacing;
|
||||
public float? bodyFacing;
|
||||
public float bodyAngle;
|
||||
public float headAngle;
|
||||
public float headBob;
|
||||
public float bodyOffsetX;
|
||||
public float bodyOffsetZ;
|
||||
public float headFacing;
|
||||
public float bodyFacing;
|
||||
|
||||
public float? genitalAngle;
|
||||
public bool? quiver;
|
||||
|
||||
public bool ShouldSerializegenitalAngle() { return genitalAngle != null; }
|
||||
public bool ShouldSerializequiver() { return quiver != null; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class ThingKeyframe : Keyframe
|
||||
{
|
||||
public float? positionX;
|
||||
public float? positionZ;
|
||||
public float? rotation;
|
||||
public float positionX;
|
||||
public float positionZ;
|
||||
public float rotation;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue