code:
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;

namespace Rimworld_Animations
{
    public class PawnRenderSubWorker_HideWhenAnimating : PawnRenderSubWorker
    {

        public override void EditMaterial(PawnRenderNode node, PawnDrawParms parms, ref Material material)
        {
            if (node.tree.pawn.def != ThingDefOf.Human) return;

            if (node.tree.rootNode.AnimationWorker is AnimationWorker_KeyframesExtended
                || node.tree.rootNode.children.Any(x => x.AnimationWorker is AnimationWorker_KeyframesExtended))
            {
                material.color = Color.clear;
                material.shader = ShaderTypeDefOf.Transparent.Shader;
            }
        }

        public override void TransformLayer(PawnRenderNode node, PawnDrawParms parms, ref float layer)
        {

            base.TransformLayer(node, parms, ref layer);

            if (node.tree.pawn.def != ThingDefOf.Human) return;
            layer -= 1000;
        }

    }

}


code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using rjw.Modules.Interactions.Helpers;
using rjw.Modules.Interactions.Objects;
using UnityEngine;
using Verse;
using Verse.AI;
using rjw.Modules.Interactions.Enums;

namespace Rimworld_Animations {
    public static class AnimationUtility {

        public static void StartAnimation(List<Pawn> participants)
        {
            participants[0].Drawer.renderer.SetAnimation(AnimationDefOf.TestAnimation1);
            participants[1].Drawer.renderer.SetAnimation(AnimationDefOf.TestAnimation2);
        }

        //startgroupanimator with anchor
        //don't anchor to self if anchor is self
        public static void StartGroupAnimation(List<Pawn> participants, GroupAnimationDef groupAnimationDef, int reorder, Thing anchor)
        {

            int seed = GenTicks.TicksGame;

            for (int i = 0; i < participants.Count; i++)
            {

                groupAnimationDef.GetOffset(i, participants[i], out Vector3? position, out int? rotation, reorder);

                if (anchor is Pawn pawn && pawn == participants[i])
                {

                    List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
                    participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, position, rotation);
                }
                else
                {
                    //each participant gets their own unique extendedanimatoranchor, important for scribe_deep saving
                    List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
                    BaseExtendedAnimatorAnchor animatorAnchor = new ExtendedAnimatorAnchor_Thing(anchor);

                    if (RJWAnimationSettings.debugMode)
                    {
                        Log.Message("Now playing animation: " + groupAnimationDef.defName + " Actor Shift: " + reorder);
                    }

                    participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, position, rotation, animatorAnchor);
                }
            }
        }

        //startgroupanimation without anchor; just play where standing
        public static void StartGroupAnimation(List<Pawn> participants, GroupAnimationDef groupAnimationDef, int reorder)
        {
            int seed = GenTicks.TicksGame;

            for (int i = 0; i < participants.Count; i++)
            {
                List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
                groupAnimationDef.GetOffset(i, participants[i], out Vector3? position, out int? rotation, reorder);
                participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, position, rotation);
            }
        }

        public static void StopGroupAnimation(List<Pawn> participants)
        {
            foreach(Pawn pawn in participants)
            {
                pawn.TryGetComp<CompExtendedAnimator>()?.StopAnimating();
            }
        }

        public static void StopGroupAnimation(Pawn participant)
        {
            participant.TryGetComp<CompExtendedAnimator>()?.StopAnimating();
        }

        public static GroupAnimationDef FindGroupAnimation(List<Pawn> participants, out int reorder)
        {
            // go through each context in each GroupAnimationDef
            // if you find one where it returns canAnimationBeUsed (and reorders),
            // return that animation

            //find all, reorder randomly, then find max priority context
            DefDatabase<GroupAnimationDef>.AllDefsListForReading
                .FindAll((GroupAnimationDef x) => x.canAnimationBeUsed(participants))
                .OrderBy(_ => Rand.Int)
                .TryMaxBy((GroupAnimationDef x) => x.Priority(participants), out GroupAnimationDef result);

            reorder = result != null ? result.Reorder(participants) : 0;
            return result;

        }

        public static int GetAnimationLength(Pawn pawn)
        {
            return pawn.TryGetComp<CompExtendedAnimator>().AnimationLength;
        }

    }
}

repo_name: Modcollector/rimworld

license: unknown


code:
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace Rimworld_Animations
{
    public class VoiceDef : Def
    {

        public List<ThingDef> races = new List<ThingDef>();
        public Gender gender = Gender.None;
        public List<TraitDef> traits = new List<TraitDef>();
        public bool takesPriority = false;
        public float randomChanceFactor = 1;

        public Dictionary<VoiceTagDef, SoundDef> sounds = new Dictionary<VoiceTagDef, SoundDef>();

        public bool VoiceFitsPawn(Pawn pawn)
        {

            //doesn't match any of the races
            if (!races.Exists(x => x == pawn.def)) return false;

            //doesn't match gender
            if (gender != Gender.None && pawn.gender != gender) return false;

            //if traits list is not empty, and pawn doesn't have any of the designated traits, doesn't match
            if (!traits.Empty() && !traits.Any(trait => pawn.story.traits.HasTrait(trait))) return false;

            return true;

        }

    }
}


code:
using RimWorld;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rimworld_Animations
{
    [DefOf]
    public static class VoiceDefOf
    {
        static VoiceDefOf()
        {
            DefOfHelper.EnsureInitializedInCtor(typeof(VoiceDefOf));
        }

        public static VoiceDef Voice_HumanMale;
        public static VoiceDef Voice_HumanFemale;
    }
}


code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace Rimworld_Animations
{
    public class VoiceTagDef : Def
    {

        public float probability = 1;

    }
}


code:
<?xml version="1.0" encoding="utf-8"?>

<ModMetaData>
	<name>Rimworld Animations 2.0</name>
	<author>C0ffee</author>
  <url>https://gitgud.io/c0ffeeeeeeee/rimworld-animations</url>
	<supportedVersions>

1.5

	</supportedVersions>
	<packageId>c0ffee.rimworld.animations</packageId>
	<modDependencies>

			<packageId>brrainz.harmony</packageId>
			<displayName>Harmony</displayName>
			<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
			<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>

			<packageId>UnlimitedHugs.HugsLib</packageId>
			<displayName>HugsLib</displayName>
			<downloadUrl>https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest</downloadUrl>
			<steamWorkshopUrl>steam://url/CommunityFilePage/818773962</steamWorkshopUrl>

			<packageId>rim.job.world</packageId>
			<displayName>RimJobWorld</displayName>
			<downloadUrl>https://www.loverslab.com/topic/110270-mod-rimjobworld/</downloadUrl>

	</modDependencies>
	<loadAfter>

UnlimitedHugs.HugsLib

brrainz.harmony

erdelf.humanoidalienraces

nals.facialanimation

com.yayo.yayoAni

	</loadAfter>
	<loadBefore>
	</loadBefore>
	<incompatibleWith>
	</incompatibleWith>
	<description>
    Rimworld Animations 2.0! Hurray!

    Questions or bugs?
    Chat with me on the forums: https://www.loverslab.com/topic/140386-rjw-animations/
    Or on the rjw discord: https://discord.gg/CXwHhv8

  </description>
</ModMetaData>


code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
  <identifier>Rimworld-Animations</identifier>
  <version>2.0.0</version>
</Manifest>


code:
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>

	<!-- Mod menu -->
	<RimAnim_ModSettings>RJW Animation Settings</RimAnim_ModSettings>
	<RimAnim_SoundOverride>启用声音覆盖</RimAnim_SoundOverride>
	<RimAnim_GenitalRotation>控制生殖器旋转</RimAnim_GenitalRotation>
	<RimAnim_OrgasmQuiver>启用高潮颤抖</RimAnim_OrgasmQuiver>
	<RimAnim_RapeShiver>启用强奸颤动</RimAnim_RapeShiver>
	<RimAnim_HeartsDuringLovin>性爱时启用心形</RimAnim_HeartsDuringLovin>
	<RimAnim_PlayNonsexual>播放非性行为的动画 (牵手、亲热)</RimAnim_PlayNonsexual>
	<RimAnim_AnimManagerTab>启用动画管理器选项卡</RimAnim_AnimManagerTab>
	<RimAnim_ShiverIntensity>颤抖/颤动强度 (默认为 2): </RimAnim_ShiverIntensity>
	<RimAnim_Voices>在动画期间播放语音</RimAnim_Voices>
	<RimAnim_HumanlikeVoicesDefault>如果没有找到外星种族的声音，则默认播放人类的声音</RimAnim_HumanlikeVoicesDefault>
	<RimAnim_DebugMode>调试模式</RimAnim_DebugMode>
	<RimAnim_FloatRangeRenderTree>调整渲染树偏移表单的浮动范围:</RimAnim_FloatRangeRenderTree>

	<!-- Main Tab Window -->
	<RimAnims_AnimManager>Animation Manager</RimAnims_AnimManager>
	<RimAnims_Warning>警告--一般情况下，你不想更改人类偏移值，只想更改外星种族偏移值或动物偏移值</RimAnims_Warning>
	<RimAnims_CopyToClipboard>将偏移值复制到剪贴板</RimAnims_CopyToClipboard>
	<RimAnims_ShareSettings>将偏移值粘贴到 OffsetDef 中，或在 Discord 中共享</RimAnims_ShareSettings>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>

	<!-- Mod menu -->
	<RimAnim_ModSettings>RJW Animation Settings</RimAnim_ModSettings>
	<RimAnim_SoundOverride>啟用聲音覆蓋</RimAnim_SoundOverride>
	<RimAnim_GenitalRotation>控制生殖器旋轉</RimAnim_GenitalRotation>
	<RimAnim_OrgasmQuiver>啟用高潮顫抖</RimAnim_OrgasmQuiver>
	<RimAnim_RapeShiver>啟用強姦顫動</RimAnim_RapeShiver>
	<RimAnim_HeartsDuringLovin>性愛時啟用心形</RimAnim_HeartsDuringLovin>
	<RimAnim_PlayNonsexual>播放非性行為的動畫 (牽手、親熱)</RimAnim_PlayNonsexual>
	<RimAnim_AnimManagerTab>啟用動畫管理器選項卡</RimAnim_AnimManagerTab>
	<RimAnim_ShiverIntensity>顫抖/顫動強度 (預設為 2): </RimAnim_ShiverIntensity>
	<RimAnim_Voices>在動畫期間播放語音</RimAnim_Voices>
	<RimAnim_HumanlikeVoicesDefault>如果沒有找到外星種族的聲音，則默認播放人類的聲音</RimAnim_HumanlikeVoicesDefault>
	<RimAnim_DebugMode>除錯模式</RimAnim_DebugMode>
	<RimAnim_FloatRangeRenderTree>調整渲染樹偏移表單的浮動範圍:</RimAnim_FloatRangeRenderTree>

	<!-- Main Tab Window -->
	<RimAnims_AnimManager>Animation Manager</RimAnims_AnimManager>
	<RimAnims_Warning>警告--一般情況下，你不想更改人類偏移值，只想更改外星種族偏移值或動物偏移值</RimAnims_Warning>
	<RimAnims_CopyToClipboard>將偏移值複製到剪貼板</RimAnims_CopyToClipboard>
	<RimAnims_ShareSettings>將偏移值黏貼到 OffsetDef 中，或在 Discord 中共享</RimAnims_ShareSettings>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>

	<!-- Mod menu -->
	<RimAnim_ModSettings>RJW Animation Settings</RimAnim_ModSettings>
	<RimAnim_SoundOverride>Enable Sound Override</RimAnim_SoundOverride>
	<RimAnim_GenitalRotation>Control Genital Rotation</RimAnim_GenitalRotation>
	<RimAnim_OrgasmQuiver>Enable Orgasm Quiver</RimAnim_OrgasmQuiver>
	<RimAnim_RapeShiver>Enable Rape Shiver</RimAnim_RapeShiver>
	<RimAnim_HeartsDuringLovin>Enable hearts during lovin'</RimAnim_HeartsDuringLovin>
	<RimAnim_PlayNonsexual>Play animation for nonsexual acts (handholding, makeout)</RimAnim_PlayNonsexual>
	<RimAnim_AnimManagerTab>Enable Animation Manager Tab</RimAnim_AnimManagerTab>
	<RimAnim_ShiverIntensity>Shiver/Quiver Intensity (default 2): </RimAnim_ShiverIntensity>
	<RimAnim_Voices>Play voices during animations</RimAnim_Voices>
	<RimAnim_HumanlikeVoicesDefault>Play human voices by default, when none found for alien race</RimAnim_HumanlikeVoicesDefault>
	<RimAnim_DebugMode>Debug Mode</RimAnim_DebugMode>
	<RimAnim_FloatRangeRenderTree>Float range for Debug Render Tree offset menu: </RimAnim_FloatRangeRenderTree>

	<!-- Main Tab Window -->
	<RimAnims_AnimManager>Animation Manager</RimAnims_AnimManager>
	<RimAnims_Warning>Warning--You generally don't want to change human offsets, only alien offsets or animals</RimAnims_Warning>
	<RimAnims_CopyToClipboard>Copy Offset to Clipboard</RimAnims_CopyToClipboard>
	<RimAnims_ShareSettings>Paste offset values in OffsetDef, or share in Discord</RimAnims_ShareSettings>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <OffsetManager.label>gerenciador de posições</OffsetManager.label>
  <OffsetManager.description>Controla as posições sexuais dos colonos.</OffsetManager.description>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Dog_Doggystyle.label>estilo cachorrinho</Dog_Doggystyle.label>
  <Horse_Cowgirl.label>vaqueira</Horse_Cowgirl.label>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Tribadism.label>tribadismo</Tribadism.label>
  <Cunnilingus.label>cunilíngua</Cunnilingus.label>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Double_Penetration.label>dupla penetração</Double_Penetration.label>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Doggystyle.label>estilo cachorrinho</Doggystyle.label>
  <Blowjob.label>boquete</Blowjob.label>
  <ReverseStandAndCarry.label>69</ReverseStandAndCarry.label>
  <Cowgirl.label>vaqueira</Cowgirl.label>

</LanguageData>


code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<loadFolders>
	<v1.1>

/

1.1

	</v1.1>
	<v1.2>

/

1.2

Patch_HatsDisplaySelection/1.2

	</v1.2>
	<v1.3>

/

1.3

Patch_HatsDisplaySelection/1.2

Patch_SexToysMasturbation

Patch_SexToysMasturbation/1.3

	</v1.3>
	<v1.4>

/

1.4

Patch_HumanoidAlienRaces/1.4

Patch_HatsDisplaySelection/1.2

Patch_SexToysMasturbation

Patch_SexToysMasturbation/1.4

	</v1.4>
	<v1.5>

/

1.5

Patch_HumanoidAlienRaces/1.5

Patch_SexToysMasturbation/1.5

Patch_FacialAnimation/1.5

Patch_NoRimNudeWorld/1.5

Patch_NoRimNudeWorldZoo/1.5

	</v1.5>

</loadFolders>


code:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{11DC70AF-FF23-4D4D-A4E5-6453664B1A12}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Milkable_Colonists_Animations</RootNamespace>
    <AssemblyName>Milkable-Colonists-Animations</AssemblyName>
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <Deterministic>true</Deterministic>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="0Harmony">
      <HintPath>..\..\..\..\..\workshop\content\294100\839005762\1.5\Assemblies\0Harmony.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Assembly-CSharp">
      <HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RJW">
      <HintPath>..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
    <Reference Include="UnityEngine">
      <HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Source\Patches\Harmony_PatchAll.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


code:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Milkable-Colonists-Animations")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Milkable-Colonists-Animations")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("11dc70af-ff23-4d4d-a4e5-6453664b1a12")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using HarmonyLib;
using System.Reflection;

namespace MC_Animations {

    [StaticConstructorOnStartup]
    public static class Harmony_PatchAll {

        static Harmony_PatchAll() {

            Harmony val = new Harmony("mcanim");
            val.PatchAll(Assembly.GetExecutingAssembly());

        }
    }
}


code:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>

</Patch>


code:
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using AlienRace;

namespace Rimworld_Animations {

	[StaticConstructorOnStartup]
	public static class HarmonyPatch_AlienRace
	{
		static HarmonyPatch_AlienRace()
		{
			(new Harmony("rjwanim")).Patch(AccessTools.Method(AccessTools.TypeByName("AlienRace.HarmonyPatches"), "DrawAddons"),
							prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_AlienRace), "Prefix_AnimateHeadAddons")));
		}

		/* todo: replace jank prefix with this
		public static void Prefix_DrawAddonsFinalHook(ref Pawn pawn, ref AlienPartGenerator.BodyAddon addon, ref Rot4 rot, ref Graphic graphic, ref Vector3 offsetVector, ref float angle, ref Material mat)
        {
			CompBodyAnimator animator = pawn.TryGetComp<CompBodyAnimator>();

			if (animator == null || !animator.isAnimating)
            {
				return;
            }

			if(addon.alignWithHead || addon.drawnInBed)
            {
				rot = animator.headFacing;
				angle = animator.headAngle;
				offsetVector += animator.deltaPos + animator.bodyAngle * animator.headBob;

			}
			else
            {
				rot = animator.bodyFacing;
				angle = animator.bodyAngle;
				offsetVector += animator.deltaPos;
            }

        }
		*/
		public static bool Prefix_AnimateHeadAddons(PawnRenderFlags renderFlags, Vector3 vector, Vector3 headOffset, Pawn pawn, Quaternion quat, Rot4 rotation)
		{

			if (renderFlags.FlagSet(PawnRenderFlags.Portrait) || !CompBodyAnimator.IsAnimating(pawn)) return true;
			if (!(pawn.def is ThingDef_AlienRace alienProps) || renderFlags.FlagSet(PawnRenderFlags.Invisible)) return false;

			List<AlienPartGenerator.BodyAddon> addons = alienProps.alienRace.generalSettings.alienPartGenerator.bodyAddons;
			AlienPartGenerator.AlienComp comp = pawn.GetComp<AlienPartGenerator.AlienComp>();
			CompBodyAnimator pawnAnimator = pawn.TryGetComp<CompBodyAnimator>();

			bool flag = renderFlags.FlagSet(PawnRenderFlags.Portrait);
			bool flag2 = renderFlags.FlagSet(PawnRenderFlags.Invisible);

			for (int i = 0; i < addons.Count; i++)
			{
				AlienPartGenerator.BodyAddon ba = addons[index: i];

				if (!ba.CanDrawAddon(pawn: pawn)) continue;

				bool forceDrawForBody = false;
				if (alienProps.defName.Contains("Orassan") && ba.path.ToLower().Contains("tail"))
                {
					forceDrawForBody = true;
                }
				AlienPartGenerator.RotationOffset offset = ba.defaultOffsets.GetOffset((ba.drawnInBed && !forceDrawForBody) || ba.alignWithHead ? pawnAnimator.headFacing : pawnAnimator.bodyFacing);
				Vector3 a = (offset != null) ? offset.GetOffset(renderFlags.FlagSet(PawnRenderFlags.Portrait), pawn.story.bodyType, pawn.story.headType) : Vector3.zero;
				AlienPartGenerator.RotationOffset offset2 = ba.offsets.GetOffset((ba.drawnInBed && !forceDrawForBody) || ba.alignWithHead ? pawnAnimator.headFacing : pawnAnimator.bodyFacing);
				Vector3 vector2 = a + ((offset2 != null) ? offset2.GetOffset(renderFlags.FlagSet(PawnRenderFlags.Portrait), pawn.story.bodyType, pawn.story.headType) : Vector3.zero);
				vector2.y = (ba.inFrontOfBody ? (0.3f + vector2.y) : (-0.3f - vector2.y));
				float num = ba.angle;
				if (((ba.drawnInBed && !forceDrawForBody) || ba.alignWithHead ? pawnAnimator.headFacing : pawnAnimator.bodyFacing) == Rot4.North)
				{
					if (ba.layerInvert)
					{
						vector2.y = 0f - vector2.y;
					}
					num = 0f;
				}
				if (((ba.drawnInBed && !forceDrawForBody) || ba.alignWithHead ? pawnAnimator.headFacing : pawnAnimator.bodyFacing) == Rot4.East)
				{
					num = 0f - num;
					vector2.x = 0f - vector2.x;
				}
				Graphic addonGraphic = comp.addonGraphics[i];

				addonGraphic.drawSize = ((flag && ba.drawSizePortrait != Vector2.zero) ? ba.drawSizePortrait : ba.drawSize) * (ba.scaleWithPawnDrawsize ? (ba.alignWithHead ? ((flag ? comp.customPortraitHeadDrawSize : comp.customHeadDrawSize) * (ModsConfig.BiotechActive ? (pawn.ageTracker.CurLifeStage.headSizeFactor ?? 1.5f) : 1.5f)) : ((flag ? comp.customPortraitDrawSize : comp.customDrawSize) * (ModsConfig.BiotechActive ? pawn.ageTracker.CurLifeStage.bodySizeFactor : 1f) * 1.5f)) : (Vector2.one * 1.5f));

				if ((ba.drawnInBed && !forceDrawForBody) || ba.alignWithHead)
				{

					Quaternion addonRotation = Quaternion.AngleAxis(pawnAnimator.headAngle < 0 ? 360 - (360 % pawnAnimator.headAngle) : pawnAnimator.headAngle, Vector3.up);

					GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: pawnAnimator.headFacing), loc: vector + (ba.alignWithHead ? headOffset : headOffset - addonRotation * pawn.Drawer.renderer.BaseHeadOffsetAt(pawnAnimator.headFacing)) + vector2.RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: addonRotation)) * 2f * 57.29578f),
					quat: Quaternion.AngleAxis(angle: num, axis: Vector3.up) * addonRotation, mat: addonGraphic.MatAt(rot: pawnAnimator.headFacing), renderFlags.FlagSet(PawnRenderFlags.DrawNow));

				}

				else
				{
					Quaternion addonRotation;
					if (AnimationSettings.controlGenitalRotation && ba.path.ToLower().Contains("penis"))
                    {
						addonRotation = Quaternion.AngleAxis(pawnAnimator.genitalAngle, Vector3.up);
					}
					else
                    {
						addonRotation = Quaternion.AngleAxis(pawnAnimator.bodyAngle, Vector3.up);
					}

					if (AnimationSettings.controlGenitalRotation && pawnAnimator.controlGenitalAngle && ba?.hediffGraphics != null && ba.hediffGraphics.Count != 0 && ba.hediffGraphics[0]?.path != null && (ba.hediffGraphics[0].path.Contains("Penis") || ba.hediffGraphics[0].path.Contains("penis")))
					{
						GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: rotation), loc: vector + (ba.alignWithHead ? headOffset : Vector3.zero) + vector2.RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: addonRotation)) * 2f * 57.29578f),
						quat: Quaternion.AngleAxis(angle: pawnAnimator.genitalAngle, axis: Vector3.up), mat: addonGraphic.MatAt(rot: rotation), renderFlags.FlagSet(PawnRenderFlags.DrawNow));
					}

					else
                    {
						GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: rotation), loc: vector + (ba.alignWithHead ? headOffset : Vector3.zero) + vector2.RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: addonRotation)) * 2f * 57.29578f),
						quat: Quaternion.AngleAxis(angle: num, axis: Vector3.up) * addonRotation, mat: addonGraphic.MatAt(rot: rotation), renderFlags.FlagSet(PawnRenderFlags.DrawNow));
					}

				}

			}

			return false;
		}
	}

	/*

    [HarmonyPatch(typeof(AlienRace.HarmonyPatches), "DrawAddons")]
    public static class HarmonyPatch_AlienRace {

		public static void RenderHeadAddonInAnimation(Mesh mesh, Vector3 loc, Quaternion quat, Material mat, bool drawNow, Graphic graphic, AlienPartGenerator.BodyAddon bodyAddon, Vector3 v, Vector3 headOffset, Pawn pawn, PawnRenderFlags renderFlags, Vector3 vector, Rot4 rotation)
        {

			CompBodyAnimator pawnAnimator = pawn.TryGetComp<CompBodyAnimator>();
			AlienPartGenerator.AlienComp comp = pawn.GetComp<AlienPartGenerator.AlienComp>();

			if (pawnAnimator != null && pawnAnimator.isAnimating)
            {

				if((bodyAddon.drawnInBed || bodyAddon.alignWithHead))
                {

					AlienPartGenerator.RotationOffset offset = bodyAddon.defaultOffsets.GetOffset(rotation);
					Vector3 a = (offset != null) ? offset.GetOffset(renderFlags.FlagSet(PawnRenderFlags.Portrait), pawn.story.bodyType, comp.crownType) : Vector3.zero;
					AlienPartGenerator.RotationOffset offset2 = bodyAddon.offsets.GetOffset(rotation);
					Vector3 vector2 = a + ((offset2 != null) ? offset2.GetOffset(renderFlags.FlagSet(PawnRenderFlags.Portrait), pawn.story.bodyType, comp.crownType) : Vector3.zero);
					vector2.y = (bodyAddon.inFrontOfBody ? (0.3f + vector2.y) : (-0.3f - vector2.y));
					float num = bodyAddon.angle;
					if (rotation == Rot4.North)
					{
						if (bodyAddon.layerInvert)
						{
							vector2.y = -vector2.y;
						}
						num = 0f;
					}
					if (rotation == Rot4.East)
					{
						num = -num;
						vector2.x = -vector2.x;
					}

					vector = vector + Quaternion.AngleAxis(pawnAnimator.bodyAngle, Vector3.up) * pawn.Drawer.renderer.BaseHeadOffsetAt(pawnAnimator.bodyFacing) - pawnAnimator.getPawnHeadOffset(); //convert vector into pseudo body pos for head
					quat = Quaternion.AngleAxis(pawnAnimator.headAngle, Vector3.up);
					loc = vector + (bodyAddon.alignWithHead ? headOffset : Vector3.zero) + vector2.RotatedBy(Mathf.Acos(Quaternion.Dot(Quaternion.identity, quat)) * 2f * 57.29578f);
					mat = graphic.MatAt(rot: pawnAnimator.headFacing);
				}
				else
                {

					AlienPartGenerator.RotationOffset offset = bodyAddon.defaultOffsets.GetOffset(rotation);
					Vector3 a = (offset != null) ? offset.GetOffset(renderFlags.FlagSet(PawnRenderFlags.Portrait), pawn.story.bodyType, comp.crownType) : Vector3.zero;
					AlienPartGenerator.RotationOffset offset2 = bodyAddon.offsets.GetOffset(rotation);
					Vector3 vector2 = a + ((offset2 != null) ? offset2.GetOffset(renderFlags.FlagSet(PawnRenderFlags.Portrait), pawn.story.bodyType, comp.crownType) : Vector3.zero);
					vector2.y = (bodyAddon.inFrontOfBody ? (0.3f + vector2.y) : (-0.3f - vector2.y));
					float num = bodyAddon.angle;
					if (rotation == Rot4.North)
					{
						if (bodyAddon.layerInvert)
						{
							vector2.y = -vector2.y;
						}
						num = 0f;
					}
					if (rotation == Rot4.East)
					{
						num = -num;
						vector2.x = -vector2.x;
					}
					quat = Quaternion.AngleAxis(pawnAnimator.bodyAngle, Vector3.up);
					loc = vector + (bodyAddon.alignWithHead ? headOffset : Vector3.zero) + vector2.RotatedBy(Mathf.Acos(Quaternion.Dot(Quaternion.identity, quat)) * 2f * 57.29578f);

				}

			}
			GenDraw.DrawMeshNowOrLater(mesh, loc, quat, mat, drawNow);

			/*
			if (pawnAnimator != null && !renderFlags.FlagSet(PawnRenderFlags.Portrait) && pawnAnimator.isAnimating && (bodyAddon.drawnInBed || bodyAddon.alignWithHead))
            {

				if ((pawn.def as ThingDef_AlienRace).defName == "Alien_Orassan")
                {
					orassan = true;

					if(bodyAddon.path.Contains("closed"))
                    {
						return;
                    }

					if (bodyAddon.bodyPart.Contains("ear"))

					{
						orassan = true;

						orassanv = new Vector3(0, 0, 0.23f);
						if (pawnAnimator.headFacing == Rot4.North)
						{
							orassanv.z -= 0.1f;
							orassanv.y += 1f;

							if(bodyAddon.bodyPart.Contains("left"))
                            {
								orassanv.x += 0.03f;
                            } else
                            {
								orassanv.x -= 0.03f;
							}

						}
						else if (pawnAnimator.headFacing == Rot4.East)
						{
							orassanv.x -= 0.1f;
						}
						else if (pawnAnimator.headFacing == Rot4.West)
						{
							orassanv.x = 0.1f;
						}
						else
                        {
							orassanv.z -= 0.1f;
							orassanv.y += 1f;

							if (bodyAddon.bodyPart.Contains("right"))
							{
								orassanv.x += 0.05f;
							}
							else
							{
								orassanv.x -= 0.05f;
							}
						}
						orassanv = orassanv.RotatedBy(pawnAnimator.headAngle);
					}
				}

			GenDraw.DrawMeshNowOrLater(mesh: graphic.MeshAt(rot: headRotInAnimation), loc: loc + orassanv + (bodyAddon.alignWithHead ? headOffset : Vector3.zero),// + v.RotatedBy(Mathf.Acos(Quaternion.Dot(Quaternion.identity, quat)) * 2f * 57.29578f),
					quat: Quaternion.AngleAxis(angle: num, axis: Vector3.up) * headQuatInAnimation, mat: graphic.MatAt(rot: pawnAnimator.headFacing), drawNow: drawNow);;
			}

			else
            {

			}

		}

		public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
        {
			List<CodeInstruction> ins = instructions.ToList();
			for (int i = 0; i < ins.Count; i++)
            {

				Type[] type = new Type[] { typeof(Mesh), typeof(Vector3), typeof(Quaternion), typeof(Material), typeof(bool) };

				if (ins[i].OperandIs(AccessTools.Method(typeof(GenDraw), "DrawMeshNowOrLater", type)))
                {

					yield return new CodeInstruction(OpCodes.Ldloc, (object)7); //graphic
					yield return new CodeInstruction(OpCodes.Ldloc, (object)4); //bodyAddon
					yield return new CodeInstruction(OpCodes.Ldloc, (object)5); //offsetVector/AddonOffset (v)
					yield return new CodeInstruction(OpCodes.Ldarg, (object)2); //headOffset
					yield return new CodeInstruction(OpCodes.Ldarg, (object)3); //pawn
					yield return new CodeInstruction(OpCodes.Ldarg, (object)0); //renderflags
					yield return new CodeInstruction(OpCodes.Ldarg, (object)1); //vector
					yield return new CodeInstruction(OpCodes.Ldarg, (object)5); //rotation

					yield return new CodeInstruction(OpCodes.Call, AccessTools.DeclaredMethod(typeof(HarmonyPatch_AlienRace), "RenderHeadAddonInAnimation"));

                }

				else
                {
					yield return ins[i];
				}
            }
        }

		public static bool Prefix(PawnRenderFlags renderFlags, ref Vector3 vector, ref Vector3 headOffset, Pawn pawn, ref Quaternion quat, ref Rot4 rotation)
		{
			if(pawn == null)
            {
				return true;
			}

			CompBodyAnimator anim = pawn.TryGetComp<CompBodyAnimator>();

			if(anim == null)
            {
				return true;
            }

			if (anim != null && !renderFlags.FlagSet(PawnRenderFlags.Portrait) && anim.isAnimating)
			{
				//quat = Quaternion.AngleAxis(anim.bodyAngle, Vector3.up);
			}

			return true;

		}
	}

	*/

}


code:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{C76F3790-9AC0-4827-ACD5-84174238954F}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Patch_HumanoidAlienRaces</RootNamespace>
    <AssemblyName>Patch_HumanoidAlienRaces</AssemblyName>
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <Deterministic>true</Deterministic>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <DebugType>none</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>1.5\Assemblies\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="0Harmony">
      <HintPath>..\..\..\..\..\workshop\content\294100\839005762\1.4\Assemblies\0Harmony.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AlienRace">
      <HintPath>..\..\..\..\..\workshop\content\294100\839005762\1.5\Assemblies\AlienRace.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Assembly-CSharp">
      <HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Rimworld-Animations">
      <HintPath>..\1.4\Assemblies\Rimworld-Animations.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RJW">
      <HintPath>..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
    <Reference Include="UnityEngine">
      <HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="UnityEngine.CoreModule">
      <HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="1.5\Source\Patches\Harmony_PatchAll.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="1.5\Assemblies\Patch_HumanoidAlienRaces.dll" />
  </ItemGroup>
  <ItemGroup />
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


code:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Patch_HumanoidAlienRaces")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Patch_HumanoidAlienRaces")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c76f3790-9ac0-4827-acd5-84174238954f")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


code:
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
	<!-- placeholder for when RimNude isn't installed -->
	<PawnRenderNodeTagDef>
		<defName>RimNude_Penis</defName>
	</PawnRenderNodeTagDef>
</Defs>


code:
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
	<!-- placeholder for when RimNude isn't installed -->
	<PawnRenderNodeTagDef>
		<defName>AnimalPenis</defName>
	</PawnRenderNodeTagDef>
</Defs>


code:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rimworld-Animations")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Rimworld-Animations")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("71b05d71-67b2-4014-82cd-18c20ac0882f")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


code:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{71B05D71-67B2-4014-82CD-18C20AC0882F}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Rimworld_Animations</RootNamespace>
    <AssemblyName>Rimworld-Animations</AssemblyName>
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <Deterministic>true</Deterministic>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <DebugType>none</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>1.5\Assemblies\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="0Harmony">
      <HintPath>..\..\..\..\workshop\content\294100\839005762\1.4\Assemblies\0Harmony.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AlienRace">
      <HintPath>..\..\..\..\workshop\content\294100\839005762\1.4\Assemblies\AlienRace.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Assembly-CSharp">
      <HintPath>..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RJW">
      <HintPath>..\rjw\1.5\Assemblies\RJW.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RJW-ToysAndMasturbation">
      <HintPath>..\rjw-toys-and-masturbation\Assemblies\RJW-ToysAndMasturbation.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
    <Reference Include="UnityEngine">
      <HintPath>..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="UnityEngine.CoreModule">
      <HintPath>..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="UnityEngine.IMGUIModule">
      <HintPath>..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="1.5\Source\Actors\Actor.cs" />
    <Compile Include="1.5\Source\Actors\AlienRaceOffset.cs" />
    <Compile Include="1.5\Source\Animations\AnimationOffsets\AnimationOffsetDef.cs" />
    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\AnimationOffset_AgeRange.cs" />
    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\AnimationOffset_BodyType.cs" />
    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\AnimationOffset_BodyTypeGendered.cs" />
    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\AnimationOffset_Single.cs" />
    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\BaseAnimationOffset.cs" />
    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\BodyTypeOffset.cs" />
    <Compile Include="1.5\Source\Animations\AnimationProps\AnimationPropDef.cs" />
    <Compile Include="1.5\Source\Animations\AnimationWorkers\AnimationWorker_KeyframesExtended.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\BasePawnTest.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Never.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Humanlike.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_PrisonerOfColony.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_SlaveOfColony.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Always.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_JobDef.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Multi.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Race.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_RJWCanBeFucked.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_RJWCanFuck.cs" />
    <Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Trait.cs" />
    <Compile Include="1.5\Source\Comps\CompExtendedAnimator.cs" />
    <Compile Include="1.5\Source\Comps\CompProperties_ExtendedAnimator.cs" />
    <Compile Include="1.5\Source\Comps\CompProperties_ThingAnimator.cs" />
    <Compile Include="1.5\Source\Comps\CompThingAnimator.cs" />
    <Compile Include="1.5\Source\Comps\ExtendedAnimatorAnchor\BaseExtendedAnimatorAnchor.cs" />
    <Compile Include="1.5\Source\Comps\ExtendedAnimatorAnchor\ExtendedAnimatorAnchor_Thing.cs" />
    <Compile Include="1.5\Source\Comps\ExtendedAnimatorAnchor\ExtendedAnimatorAnchor_Vector3.cs" />
    <Compile Include="1.5\Source\Defs\AnimationDefOf.cs" />
    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationContexts\BaseGroupAnimationContext.cs" />
    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationContexts\GroupAnimationContext_RJWSex.cs" />
    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationDef.cs" />
    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage.cs" />
    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage_Branch.cs" />
    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage_LoopRandomSelectChance.cs" />
    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage_TicksDuration.cs" />
    <Compile Include="1.5\Source\Animations\Keyframes\ExtendedKeyframe.cs" />
    <Compile Include="1.5\Source\MainTabWindows\MainTabWindow_OffsetConfigure.cs" />
    <Compile Include="1.5\Source\MainTabWindows\OffsetMainButtonDefOf.cs" />
    <Compile Include="1.5\Source\MainTabWindows\WorldComponent_UpdateMainTab.cs" />
    <Compile Include="1.5\Source\Patches\Harmony_PatchAll.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_Dialog_DebugRenderTree.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_GetFinalizedMaterial.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderer.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderNode.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderNodeWorker.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderTree.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_Pawn_DrawTracker.cs" />
    <Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_Thing.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\JobDriver_Sex\HarmonyPatch_Animate.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\JobDriver_Sex\HarmonyPatch_PlaySexSounds.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\JobDriver_Sex\HarmonyPatch_SexTick.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\HarmonyPatch_WorkGiverSex.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_JoinInBed.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_Sex.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_SexBaseInitiator.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\SexBaseReceivers\HarmonyPatch_JobDriver_SexBaseReceiverRaped.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\SexBaseReceivers\HarmonyPatch_JobDriver_SexBaseReceiverLoved.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicBodyTypeVariants\PawnRenderNodeProperties_GraphicBodyTypeVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicBodyTypeVariants\PawnRenderNodeWorker_GraphicBodyTypeVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicBodyTypeVariants\PawnRenderNode_GraphicBodyTypeVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicHediffSeverityVariants\PawnRenderNodeProperties_GraphicHediffSeverityVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicHediffSeverityVariants\PawnRenderNodeWorker_GraphicHediffSeverityVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicHediffSeverityVariants\PawnRenderNode_GraphicHediffSeverityVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicHediffVariants\PawnRenderNodeProperties_GraphicHediffVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicHediffVariants\PawnRenderNodeWorker_GraphicHediffVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicHediffVariants\PawnRenderNode_GraphicHediffVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicVariants\PawnRenderNodeProperties_GraphicVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicVariants\PawnRenderNodeWorker_GraphicVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\GraphicVariants\PawnRenderNode_GraphicVariants.cs" />
    <Compile Include="1.5\Source\PawnRenderNode\TexPathVariants.cs" />
    <Compile Include="1.5\Source\RenderSubWorkers\PawnRenderSubWorker_ChangeOffset.cs" />
    <Compile Include="1.5\Source\Patches\RJWPatches\RJWAnimationSettings.cs" />
    <Compile Include="1.5\Source\RenderSubWorkers\PawnRenderSubWorker_HideWhenAnimating.cs" />
    <Compile Include="1.5\Source\Utilities\AnimationUtility.cs" />
    <Compile Include="1.5\Source\Voices\VoiceDef.cs" />
    <Compile Include="1.5\Source\Voices\VoiceDefOf.cs" />
    <Compile Include="1.5\Source\Voices\VoiceTagDef.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="1.5\Assemblies\0MultiplayerAPI.dll" />
    <Content Include="1.5\Assemblies\Rimworld-Animations.dll" />
    <Content Include="1.5\Assemblies\RJW.dll" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\GroupAnimation_DogBeast.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage2.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage3_Variant1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage3_Variant2_FollowupWithVariant1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage3_Variant3.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage4.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage5_Variant1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage5_Variant2.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage5_Variant3.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Beast\DogBeast\Stage6.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\AnimationPropDef_Cum.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\GroupAnimation_Blowjob.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\OffsetDef_Blowjob.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage2a.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage2b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage2c.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage3.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage4a.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage4b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage4c.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage5.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage6a.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Blowjob\Stage6b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\AnimationPropDef_Cowgirl_Xray.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\Cowgirl_Stage1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\Cowgirl_Stage2_1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\Cowgirl_Stage2_2.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\Cowgirl_Stage2_3.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\Cowgirl_Stage3_XRay.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\Cowgirl_Stage4.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\Cowgirl_Stage_1_5.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\GroupAnimation_Cowgirl.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\OffsetDef_Cowgirl.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\AnimationPropDef_Saliva.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\GroupAnimation_Cunnilingus.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\OffsetDef_Cunnilingus.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage2a.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage2b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage2c.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage3_LoopOnce.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage4a.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage4b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage4c.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage5.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cunnilingus\Stage6.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\GroupAnimation_DP.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\OffsetDef_DP.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage2a.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage2b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage2c.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage2d.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage3.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage4.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage5a.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage5b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage5c.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\DoublePenetration\Stage5_Base.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\GroupAnimation_Missionary.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\OffsetDef_Missionary.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage2.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage2b.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage2c.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage3_DontLoop.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage4.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage5.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Missionary\Stage6.xml" />
    <Content Include="1.5\Defs\AnimationPropDefs\AnimationPropDef_Hand.xml" />
    <Content Include="1.5\Defs\OffsetDefs\OffsetDef_Placeholder.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\1 Intro\Doggystyle Intro1.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\1 Intro\Doggystyle Intro2.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\1 Intro\Doggystyle Intro3.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\1 Intro\Doggystyle1a.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\2 Main\Doggystyle1b.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\2 Main\Doggystyle2.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\2 Main\Doggystyle3.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\2 Main\Doggystyle4.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\2 Main\Doggystyle5.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\2 Main\Doggystyle6.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\2 Main\Doggystyle7.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\3 Ending\Doggystyle8.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\3 Ending\Doggystyle8a.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\3 Ending\Doggystyle8b.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\3 Ending\Doggystyle8c.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\3 Ending\Doggystyle8d.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\3 Ending\Doggystyle8e.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\Misc\AnimationPropDef_BEV.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\Misc\GroupAnimation_Doggystyle_Condom_BEV.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\Misc\OffsetDef_Doggystyle_BEV.xml" />
    <Content Include="1.5\Defs\TestDoNotPush\Experimental\Misc\TexPathVariants_Doggystyle_BEV.xml" />
    <Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_XrayPenis_Human.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\TestAnimation\TestAnimation1.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\TestAnimation\TestAnimation2.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\TestAnimation\TestAnimation3.xml" />
    <Content Include="1.5\Defs\AnimationPropDefs\AnimationPropDef_Knees.xml" />
    <Content Include="1.5\Defs\AnimationPropDefs\AnimationPropDef_Xray_Inside.xml" />
    <Content Include="1.5\Defs\AnimationPropDefs\AnimationPropDef_Banana.xml" />
    <Content Include="1.5\Defs\AnimationPropDefs\AnimationPropDef_Xray_Penis.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\TestAnimation\TestGroupAnimation1.xml" />
    <Content Include="1.5\Defs\MainTabDefs\MainButtonDef.xml" />
    <Content Include="1.5\Defs\OffsetDefs\OffsetDef_GroinToAppropriateHeight.xml" />
    <Content Include="1.5\Defs\SoundDefs\Sounds_Sex.xml" />
    <Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_Cat.xml" />
    <Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_Arms.xml" />
    <Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_Knees.xml" />
    <Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_Xray_Inside.xml" />
    <Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_XrayPenis_Horse.xml" />
    <Content Include="1.5\Defs\GroupAnimationDefs\Cowgirl\TexPathVariants_Cowgirl.xml" />
    <Content Include="1.5\Defs\VoiceDefs\VoiceDef_Human\SoundDef_HumanFemale.xml" />
    <Content Include="1.5\Defs\VoiceDefs\VoiceDef_Human\SoundDef_HumanMale.xml" />
    <Content Include="1.5\Defs\VoiceDefs\VoiceDef_Human\VoiceDef_Human.xml" />
    <Content Include="1.5\Defs\VoiceDefs\VoiceDef_Orassan.xml" />
    <Content Include="1.5\Defs\VoiceDefs\VoiceTagDef.xml" />
    <Content Include="1.5\Patches\AnimationPatchHSK.xml" />
    <Content Include="1.5\Patches\AnimationPatch_CompExtendedAnimator.xml" />
    <Content Include="1.5\Patches\AnimationPatch_PawnRenderTree_OffsetSubWorker.xml" />
    <Content Include="1.5\Patches\CompatibilityPatch_FacialAnimation.xml" />
    <Content Include="1.5\Patches\CompatibilityPatch_HCSK.xml" />
    <Content Include="1.5\Patches\CompPatches\AutoCleaner.xml" />
    <Content Include="1.5\Patches\CompPatches\CombatExtended.xml" />
    <Content Include="1.5\Patches\CompPatches\ZombieLand.xml" />
    <Content Include="1.5\Patches\Patch_GenitaliaRenderNode.xml" />
    <Content Include="1.5\Sounds\Sex\Clap_1.wav" />
    <Content Include="1.5\Sounds\Sex\Clap_2.wav" />
    <Content Include="1.5\Sounds\Sex\Clap_3.wav" />
    <Content Include="1.5\Sounds\Sex\Clap_4.wav" />
    <Content Include="1.5\Sounds\Sex\Clap_5.wav" />
    <Content Include="1.5\Sounds\Sex\Clap_6.wav" />
    <Content Include="1.5\Sounds\Sex\Clap_7.wav" />
    <Content Include="1.5\Sounds\Sex\Clap_8.wav" />
    <Content Include="1.5\Sounds\Sex\cum.wav" />
    <Content Include="1.5\Sounds\Sex\kucyu04.wav" />
    <Content Include="1.5\Sounds\Sex\Slap\Slap_1.wav" />
    <Content Include="1.5\Sounds\Sex\Slap\Slap_2.wav" />
    <Content Include="1.5\Sounds\Sex\Slap\Slap_3.wav" />
    <Content Include="1.5\Sounds\Sex\Slap\Slap_4.wav" />
    <Content Include="1.5\Sounds\Sex\Slap\Slap_5.wav" />
    <Content Include="1.5\Sounds\Sex\Slime\Slimy1.wav" />
    <Content Include="1.5\Sounds\Sex\Slime\Slimy2.wav" />
    <Content Include="1.5\Sounds\Sex\Slime\Slimy3.wav" />
    <Content Include="1.5\Sounds\Sex\Slime\Slimy4.wav" />
    <Content Include="1.5\Sounds\Sex\Slime\Slimy5.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_1.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_10.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_2.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_3.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_4.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_5.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_6.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_7.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_8.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Suck_9.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Swallow_1.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Swallow_2.wav" />
    <Content Include="1.5\Sounds\Sex\Suck\Swallow_3.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Grunt1.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Grunt2.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Grunt3.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Grunt4.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Grunt5.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Grunt6.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Moan1.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Moan2.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Moan3.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Moan4.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\MoanShort1.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\MoanShort2.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\MoanShort3.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Scream1.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Scream2.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Scream3.wav" />
    <Content Include="1.5\Sounds\Voices\FVoice\Scream4.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Grunt1.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Grunt2.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Grunt3.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Grunt4.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Moan1.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Moan2.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Moan3.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Moan4.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\MoanShort1.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\MoanShort2.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\MoanShort3.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Scream1.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Scream2.wav" />
    <Content Include="1.5\Sounds\Voices\MVoice\Scream3.wav" />
    <Content Include="1.5\Textures\AnimationProps\Banana\Banana_east.png" />
    <Content Include="1.5\Textures\AnimationProps\Banana\Banana_north.png" />
    <Content Include="1.5\Textures\AnimationProps\Banana\Banana_south.png" />
    <Content Include="1.5\Textures\AnimationProps\Banana\Banana_west.png" />
    <Content Include="1.5\Textures\AnimationProps\Cat\Cat1_north.png" />
    <Content Include="1.5\Textures\AnimationProps\Cat\Cat2_north.png" />
    <Content Include="1.5\Textures\AnimationProps\Cum\Cum.png" />
    <Content Include="1.5\Textures\AnimationProps\Doggystyle\Doggy_Arms_north.png" />
    <Content Include="1.5\Textures\AnimationProps\Doggystyle\Doggy_Legs_north.png" />
    <Content Include="1.5\Textures\AnimationProps\Hand\Hand_north.png" />
    <Content Include="1.5\Textures\AnimationProps\MissingTexture\MissingTexture_east.png" />
    <Content Include="1.5\Textures\AnimationProps\MissingTexture\MissingTexture_north.png" />
    <Content Include="1.5\Textures\AnimationProps\MissingTexture\MissingTexture_south.png" />
    <Content Include="1.5\Textures\AnimationProps\MissingTexture\MissingTexture_west.png" />
    <Content Include="1.5\Textures\AnimationProps\CowgirlXray\XRay2-1.png" />
    <Content Include="1.5\Textures\AnimationProps\CowgirlXray\XRay2-2.png" />
    <Content Include="1.5\Textures\AnimationProps\CowgirlXray\XRay2-3.png" />
    <Content Include="1.5\Textures\AnimationProps\CowgirlXray\XRay2-4.png" />
    <Content Include="1.5\Textures\AnimationProps\CowgirlXray\XRay2-5.png" />
    <Content Include="1.5\Textures\AnimationProps\CowgirlXray\XRay2-6.png" />
    <Content Include="1.5\Textures\AnimationProps\Saliva\Saliva_north.png" />
    <Content Include="1.5\Textures\UI\MainTab.png" />
    <Content Include="About\About.xml" />
    <Content Include="About\Manifest.xml" />
    <Content Include="Languages\English\Keyed\RJWAnimations-LanguageData.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\MainButtonDef\MainButtonDef.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_Beast.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_Lesbian.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_Multi.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_vanilla.xml" />
    <Content Include="LoadFolders.xml" />
    <Content Include="Patch_FacialAnimation\1.5\Patches\AnimationPatch_HideHeadWhenAnimating.xml" />
    <Content Include="Patch_NoRimNudeWorldZoo\1.5\Defs\PawnRenderNodeTagDef_AnimalPenisPlaceholder.xml" />
    <Content Include="Patch_NoRimNudeWorld\1.5\Defs\PawnRenderNodeTagDef_RimnudePenisPlaceholder.xml" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="1.5\Source\Extensions\" />
    <Folder Include="1.5\Source\Patches\OtherModPatches\" />
    <Folder Include="1.5\Source\Settings\" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


code:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29905.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rimworld-Animations", "Rimworld-Animations.csproj", "{71B05D71-67B2-4014-82CD-18C20AC0882F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Milkable-Colonists-Animations", "Milkable-Colonists-Animations\Milkable-Colonists-Animations.csproj", "{11DC70AF-FF23-4D4D-A4E5-6453664B1A12}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Release|Any CPU.Build.0 = Release|Any CPU
		{11DC70AF-FF23-4D4D-A4E5-6453664B1A12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{11DC70AF-FF23-4D4D-A4E5-6453664B1A12}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{11DC70AF-FF23-4D4D-A4E5-6453664B1A12}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{11DC70AF-FF23-4D4D-A4E5-6453664B1A12}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {7E01292A-D76F-4CA3-AA64-085B84ECD905}
	EndGlobalSection
EndGlobal


code:
*.bat	text eol=crlf
*.tw	text eol=lf
*.sh	text eol=lf
*.py	text eol=lf
*.txt	text eol=lf
compile	text eol=lf
compile-git	text eol=lf
sanityCheck	text eol=lf

path: .gitattributes


code:
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.swp
*.swo

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Start.tw
src/config/start.tw

# eslint
.eslintrc.js
node_modules
package-lock.json
package.json

# TODO
TODO.txt

# outlines
*.outline

# misc
fc-pregmod

path: .gitignore


code:
further development:
-specialized slave schools
-fortifications
-more levels for militia edict (further militarize society)
-conquering other arcologies?

Events:
-famous criminal escapes to the arcology, followed by another arcology police force

Bugs:
-sometimes troop counts breaks
-sometimes rebel numbers have fractionary parts

Rules Assistant:
- find a way for the new intense drugs to fit in
- everything mentioned in https://gitgud.io/pregmodfan/fc-pregmod/issues/81

main.tw porting:
- slaveart
- createsimpletabs
- displaybuilding
- optionssortasappearsonmain
- resetassignmentfilter
- mainlinks
- arcology description
- office description
- slave summary
- use guard
- toychest
- walk past

DCoded:

Farmyard
- allow adoption of animals (potentially allow them to be customized)
- add animals to slave v slave fights - loser gets fucked, etc
- add female animal-on-slave scene
- add animal-human pregnancy
- allow slaves to be assigned to the Farmyard
- add zoo
    - open to the public / charge admission
    - assign slaves to generate more income / rep
    - maybe attract immigrants

Nursery
X create Nursery
- create array / list of babies in Nursery with their age (starts at 0, week 0), basic genetics (skin color, eye color)
- add a list or variable to slave array with number of children sent to Nursery
- hardcap of 50 (40?)
- add option to kick out babies if space is needed
- rewrite certain areas
- rewrite nursery.tw and incubator.tw with link macros

Misc
- rework seNonlethalPit.tw to take different variables into account (virginity, devotion / trust, fetishes / quirks, etc)
    X rewrite seNonlethalPit.tw - have slave come in naked and bound, then have the animal chase her around and see how long she'll last
- add personality types
- add boomerang to "gated community" event
X add check for amputees in killSlave


code:
# How to vector art

Please read the whole document before starting to work.
Some aspects are not obvious right away.

Note: This does not actually describe how to be an artist.

## TL;DR

    killall inkscape
    artTools/vector_layer_split.py artTools/vector_source.svg tw src/art/vector/layers/
    compile
    python3 artTools/normalize_svg.py artTools/vector_source.svg
    git commit -a

## 1. Be an artist

Make changes to the vector_source.svg.
Inkscape was thoroughly tested.
Adobe Illustrator might work decently, too.

## 2. Respect the structure

While editing, keep the Layers in mind.

* In Inkscape, Layers are special "Inkscape groups".
* In Illustrator, Layers are groups with user-definded IDs.
* All Layers should have an ID that is globally unique
  (not just within their subtree).

* Please use anonymous groups only for the ease of editing. Remove all "helper" groups before finally saving the file.
* Anonymous groups can be used for continous scaling (of e.g. boobs).

* Every asset that should go into a separate file needs to be in a labelled group
  (even if that is a group with only one shape).
* There are some globally available styles defined as CSS classes (e.g. skin, hair).
  Use them if your asset should be changed upon display.
  Do not set the style directly in the object.

## 3. Normalise the document (before committing)

**THIS IS IMPORTANT**

The various editors out there (Inkscape, Illustrator) may use different variants of formatting the SVG XML.
Use

    python3 normalize_svg.py vector_source.svg

before committing to normalise the format so git will not freak out about the changed indentation.

If you use Inkscape, please use in Edit → Settings → Input/Output → SVG-Output → Path Data → Optimized. This is the default.
In case your Editor uses another path data style which cannot be changed, please contact the other artists and developers via the issue tracker to find a new common ground.

What it does:
* Formats the SVG XML according to Pythons lxml module, regardless of editor.
* Adobe Illustrator uses group IDs as layer labels.
  Inkscape however uses layer labels and a separate, auto-generated group ID.
  normalize_svg.py overwrites the group ID with the Inkscape layer label
  so they are synchronised with Inkscape layer labels.
* Inkscape copies the global style definition into the object *every time*
  the object is edited. If an object references a CSS class AND at the same time
  has a local style, the local style is removed
  so global dynamic styling is possible later on.

Note: Behaviour of Adobe Illustrator is untested.

## 4. Split the layers

For NoX original, deepurk extensions, execute

    python3 vector_layer_split.py vector_deepmurk_primary.svg tw ../src/art/vector/layers/

For faraen revamped art (based on NoX original)

	python3 vector_revamp_layer_split.py vector_revamp_source.svg tw ../src/art/vector_revamp/layers/

. This application reads all groups in `vector_source.svg`.
Each group is stored in a separate file in the target directory `/src/art/vector/layers/`.
The group ID sets the file name. Therefore, the group ID **must not** contain spaces or any other weird characters.

Also consider:
* A group with ID ending in _ is ignored. Use Layers ending in _ to keep overview.
* A group with ID starting with "g" (Inkscape) or "XMLID" (Illustrator) is also ignored.
* Existing files are overwritten **without enquiry**.
* The target directory is not emptied. If a file is no longer needed, you should remove it manually.
* This procedure removes global definitions. This means, SVG filters are currently not supported.

Available output formats are `svg` and `tw`.
`svg` output exists for debug reasons.
`tw` embeds the SVG data into Twine files, but removes the global style definitions so they can be set during display.

## 5. Edit the code

`/src/art/` contains Twine code which shows the assets in the story.
There are many helpful comments in `/src/art/artWidgets.tw`.
The code also generates the previously removed global style definitions on the fly and per display.

## 6. Compile the story

Use the provided compile script (Windows batch or shell) for compiling.

## 7. Advanced usage

You can define multiple CSS classes to one element, e.g. "skin torso". When procedurally generating CSS, you can then set a global "skin" style, and a different one for "torso".

You can put variable text into the image using single quotes, e.g. "'+_tattooText+'". The single quotes *break* the quoting in Twine so the content of the Twine variable `_tattooText` is shown upon display. You can even align text on paths.

An anonymous group can be used for dynamic transformation. However, finding the correct parameters for the affine transformation matrix can be cumbersome. Use any method you see fit. See `src/art/vector/Boob.tw` for one example of the result.


code:
Apron
AttractiveLingerie
AttractiveLingerieForAPregnantWoman
BallGown
Battledress
Blouse
BodyOil
Bunny
Chains
ChattelHabit
Cheerleader
ClubslutNetting
ComfortableBodysuit
Conservative
Cutoffs
Cybersuit
FallenNunsHabit
FuckdollSuit
HalterTopDress
HaremGauze
Hijab
Huipil
Kimono
LatexCatsuit
Leotard
LongQipao
MaternityDress
MilitaryUniform
MiniDress
Monokini
NiceBusinessAttire
NiceMaid
NiceNurse
No
PenitentNunsHabit
RedArmyUniform
RestrictiveLatex
ScalemailBikini
SchoolgirlUniform
SchutzstaffelUniform
ShibariRopes
SlaveGown
Slutty
SluttyBusinessAttire
SluttyJewelry
SluttyMaid
SluttyNurse
SluttyQipao
SluttySchutzstaffelUniform
Spats
StretchPants
StringBikini
Succubus
Toga
UncomfortableStraps
Western


code:
#!/bin/bash

# This script reads all possible values of $slave.clothes as mentioned by the documentation.
# This script uses the actual implementation of the JS clothing2artSuffix function as defined in src/art/vector/Helper_Functions.tw
# This script outputs suffixes to be used in the SVG naming scheme
# This script is meant to be executed at the project root directory.
# This script depends on bash, grep, sed, paste and nodejs (so best executed on Linux, I guess)

# grep -Porh '(?<=\.clothes = )"[^"]+"' src/ | sort | uniq # searches sources for all clothes strings actually used in the game, even undocumented ones

(
  echo 'var window = {};'
  grep -v '^:' src/art/vector/Helper_Functions.tw
  echo -n 'Array('
  sed '/^clothes:/,/:/!d' "slave variables documentation - Pregmod.txt" | grep '"' | paste -sd,
  echo ').forEach(v => {console.log(window.clothing2artSuffix(v));});'
) | nodejs | sort


code:
#!/usr/bin/env python3

'''
Application for "normalizing" SVGs

These problems are addressed:

* Inkscape notoriously copies class styles into the object definitions.
https://bugs.launchpad.net/inkscape/+bug/167937

* Inkscape uses labels on layers. Layers are basically named groups.
  Inkscape does not sync the group id with the layer label.

Usage Example:
python3 inkscape_svg_fixup.py vector_source.svg
'''

import lxml.etree as etree
import sys

def fix(tree):
  # know namespaces
  ns = {
    'svg' : 'http://www.w3.org/2000/svg',
    'inkscape' : 'http://www.inkscape.org/namespaces/inkscape'
  }

  # find document global style definition
  # mangle it and interpret as python dictionary
  style_element = tree.find('./svg:style',namespaces=ns)
  style_definitions = style_element.text
  pythonic_style_definitions = '{'+style_definitions.\
  replace('\t.','"').replace('{','":"').replace('}','",').\
  replace('/*','#')+'}'
  styles = eval(pythonic_style_definitions)

  # go through all SVG elements
  for elem in tree.iter():
    if (elem.tag == etree.QName(ns['svg'], 'g')):
      # compare inkscape label with group element ID
      l = elem.get(etree.QName(ns['inkscape'], 'label'))
      if l:
        i = elem.get('id')
        if (i != l):
          print("Overwriting ID %s with Label %s..."%(i, l))
          elem.set('id', l)

    # clean styles (for easier manual merging)
    style_string = elem.get('style')
    if style_string:
      split_styles = style_string.strip('; ').split(';')
      styles_pairs = [s.strip('; ').split(':') for s in split_styles]
      filtered_pairs = [ (k,v) for k,v in styles_pairs if not (
        k.startswith('font-') or
        k.startswith('text-') or
        k.endswith('-spacing') or
        k in ["line-height", " direction", " writing", " baseline-shift", " white-space", " writing-mode"]
      )]
      split_styles = [':'.join(p) for p in filtered_pairs]
      style_string = ';'.join(sorted(split_styles))
      elem.attrib["style"] = style_string

    # remove all style attributes offending class styles
    s = elem.get('style')
    c = elem.get('class')
    if (c and s):
      s = s.lower()
      c = c.split(' ')[0] # regard main style only
      cs = ''
      if c in styles:
        cs = styles[c].strip('; ').lower()
      if (c not in styles):
        print("Object id %s references unknown style class %s."%(i,c))
      else:
        if (cs != s.strip('; ')):
          print("Style %s removed from object id %s differed from class %s style %s."%(s,i,c,cs))
        del elem.attrib["style"]

if __name__ == "__main__":
  input_file = sys.argv[1]
  tree = etree.parse(input_file)
  fix(tree)
  # store SVG into file (input file is overwritten)
  svg = etree.tostring(tree, pretty_print=True)
  with open(input_file, 'wb') as f:
    f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
    f.write(svg)


code:
#!/usr/bin/env python3

'''
Application for procedural content adaption
*THIS IS VERY EXPERIMENTAL*
Contains a very poor man's implementation of spline mesh warping.

This application parses SVG path data of an outfit sample aligned to a body part.
The outfit is then replicated for other shapes of the same body part.

Example data is geared towards generating a strap outfit for boobs and torso
for all sizes of boobs and all shapes of torsos based on a single outfit for
boobs of size 2 and a hourglass torso respectively.

Limitations:
* handles paths only
* only svg.path Line and CubicBezier are tested
* only the aforementioned examples are tested

Usage:
python3 vector_clothing_replicator.py infile clothing bodypart destinationfile

Usage Example:
python3 vector_clothing_replicator.py vector_source.svg Straps Boob vector_destination.svg
python3 vector_clothing_replicator.py vector_source.svg Straps Torso vector_destination.svg
'''

from svg.path import parse_path
import copy
import lxml.etree as etree
import sys

REFERENCE_PATH_SAMPLES = 200
EMBED_REPLICATIONS = True # wether to embed all replications into the input file or output separate files

input_file = sys.argv[1]
clothing = sys.argv[2]
bodypart = sys.argv[3]
output_file_embed = sys.argv[4]

# TODO: make these configurable
output_file_pattern = '%s_%s_%s.svg' #bodypart, target_id, clothing

if ('Torso' == bodypart):
  xpath_shape = './svg:g[@id="Torso_"]/svg:g[@id="Torso_%s"]/svg:path[@class="skin torso"]/@d' # TODO: formulate more general, independent of style
  xpath_outfit_container = '//svg:g[@id="Torso_Outfit_%s_"]'%(clothing)
  xpath_outfit = '//svg:g[@id="Torso_Outfit_%s_%s"]'%(clothing,'%s')
  target_ids = "Unnatural,Hourglass,Normal".split(",")
  reference_id = "Hourglass"
else:
  raise RuntimeError("Please specify a bodypart for clothing to replicate.")

tree = etree.parse(input_file)
ns = {'svg' : 'http://www.w3.org/2000/svg'}

canvas = copy.deepcopy(tree)
for e in canvas.xpath('./svg:g',namespaces=ns)+canvas.xpath('./svg:path',namespaces=ns):
  # TODO: this should be "remove all objects, preserve document properties"
  e.getparent().remove(e)

def get_points(xpath_shape):
  '''
  This funciton extracts reference paths by the given xpath selector.
  Each path is used to sample a fixed number of points.
  '''
  paths_data = tree.xpath(xpath_shape,namespaces=ns)
  points = []
  path_length = None
  for path_data in paths_data:
    p = parse_path(path_data)
    points += [
      p.point(1.0/float(REFERENCE_PATH_SAMPLES)*i)
      for i in range(REFERENCE_PATH_SAMPLES)
    ]
  if (not points):
    raise RuntimeError(
      'No paths for reference points found by selector "%s".'%(xpath_shape)
    )
  return points

def point_movement(point, reference_points, target_points):
  '''
  For a given point, finds the nearest point in the reference path.
  Gives distance vector from the nearest reference point to the
  respective target reference point.
  '''
  distances = [abs(point-reference_point) for reference_point in reference_points]
  min_ref_dist_idx = min(enumerate(distances), key=lambda x:x[1])[0]
  movement = target_points[min_ref_dist_idx] - reference_points[min_ref_dist_idx]
  return movement

reference_points = get_points(xpath_shape%(reference_id))
container = tree.xpath(xpath_outfit_container,namespaces=ns)
if (len(container) != 1):
  raise RuntimeError('Outfit container selector "%s" does not yield exactly one layer.'%(xpath_outfit_container))
container = container[0]
outfit_source = container.xpath(xpath_outfit%(reference_id),namespaces=ns)
if (len(outfit_source) != 1):
  raise RuntimeError('Outfit source selector "%s" does not yield exactly one outfit layer in container selected by "%s".'%(xpath_outfit%(reference_id), xpath_outfit_container))
outfit_source = outfit_source[0]

for target_id in target_ids:
  print(
    'Generating variant "%s" of clothing "%s" for bodypart "%s"...'%
    (target_id, clothing, bodypart)
  )
  outfit = copy.deepcopy(outfit_source)
  paths = outfit.xpath('./svg:path',namespaces=ns)
  if target_id == reference_id:
    print("This is the source variant. Skipping...")
  else:
    layerid = outfit.get('id').replace('_%s'%(reference_id),'_%s'%(target_id))
    outfit.set('id', layerid)
    outfit.set(etree.QName('http://www.inkscape.org/namespaces/inkscape', 'label'), layerid) # for the Inkscape-users
    target_points = get_points(xpath_shape%(target_id))
    if (len(reference_points) != len(target_points)):
      raise RuntimeError(
        ('Different amounts of sampled points in reference "%s" and target "%s" paths. '+
        'Selector "%s" probably matches different number of paths in the two layers.')%
        (reference_id, target_id, xpath_shape)
      )
    for path in paths:
      path_data = path.get("d")
      p = parse_path(path_data)
      for segment in p:
        original_distance = abs(segment.end-segment.start)
        start_movement = point_movement(segment.start, reference_points, target_points)
        segment.start += start_movement
        end_movement = point_movement(segment.end, reference_points, target_points)
        segment.end += end_movement
        distance = abs(segment.end-segment.start)
        try:
          # enhance position of CubicBezier control points
          # amplification is relative to the distance gained by movement
          segment.control1 += start_movement
          segment.control1 += (segment.control1-segment.start)*(distance/original_distance-1.0)
          segment.control2 += end_movement
          segment.control2 += (segment.control2-segment.end)*(distance/original_distance-1.0)
        except AttributeError as ae:
          # segment is not a CubicBezier
          pass
      path.set("d", p.d())
    if EMBED_REPLICATIONS:
      container.append(outfit)
  if not EMBED_REPLICATIONS:
    container = copy.deepcopy(canvas).xpath('.',namespaces=ns)[0]
    container.append(outfit)

  if not EMBED_REPLICATIONS:
    svg = etree.tostring(container, pretty_print=True)
    with open((output_file_pattern%(bodypart, target_id, clothing)).lower(), 'wb') as f:
      f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
      f.write(svg)

if EMBED_REPLICATIONS:
  svg = etree.tostring(tree, pretty_print=True)
  with open(output_file_embed, 'wb') as f:
    f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
    f.write(svg)


code:
#!/usr/bin/env python3

'''
Application for splitting groups from one SVG file into separate files

Usage:
python3 vector_layer_split.py infile format outdir

Usage Example:
python3 vector_layer_split.py vector_source.svg tw ../src/art/vector/layers/
'''

import lxml.etree as etree
import sys
import os
import copy
import re
import normalize_svg

input_file = sys.argv[1]
output_format = sys.argv[2]
output_directory = sys.argv[3]
if not os.path.exists(output_directory):
    os.makedirs(output_directory)

ns = {
  'svg' : 'http://www.w3.org/2000/svg',
  'inkscape' : 'http://www.inkscape.org/namespaces/inkscape',
  'sodipodi':"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",
}

tree = etree.parse(input_file)
normalize_svg.fix(tree)

# prepare output template
template = copy.deepcopy(tree)
root = template.getroot()

# remove all svg root attributes except document size
for a in root.attrib:
  if (a != "viewBox"):
    del root.attrib[a]

# add placeholder for CSS class (needed for workaround for non HTML 5.1 compliant browser)
if output_format == 'tw':
  root.attrib["class"] = "'+_art_display_class+'"

# remove all content, including metadata
# for twine output, style definitions are removed, too
defs = None
for e in root:
  if (e.tag == etree.QName(ns['svg'], 'defs')):
    defs = e
  if (e.tag == etree.QName(ns['svg'], 'g') or
      e.tag == etree.QName(ns['svg'], 'metadata') or
      e.tag == etree.QName(ns['svg'], 'defs') or
      e.tag == etree.QName(ns['sodipodi'], 'namedview') or
      (output_format == 'tw' and e.tag == etree.QName(ns['svg'], 'style'))
      ):
    root.remove(e)
# template preparation finished

# prepare regex for later use
regex_xmlns = re.compile(' xmlns[^ ]+',)
regex_space = re.compile('[>][ ]+[<]',)

# find all groups
layers = tree.xpath('//svg:g',namespaces=ns)
for layer in layers:
  i = layer.get('id')
  if ( # disregard non-content groups
    i.endswith("_") or # manually suppressed with underscore
    i.startswith("XMLID") or # Illustrator generated group
    i.startswith("g") # Inkscape generated group
  ):
    continue
  # create new canvas
  output = copy.deepcopy(template)
  # copy all shapes into template
  canvas = output.getroot()
  for e in layer:
    canvas.append(e)
  # represent template as SVG (binary string)
  svg = etree.tostring(output, pretty_print=False)
  # poor man's conditional defs insertion
  # TODO: extract only referenced defs (filters, gradients, ...)
  # TODO: detect necessity by traversing the elements. do not stupidly search in the string representation
  if ("filter:" in svg.decode('utf-8')):
    # it seems there is a filter referenced in the generated SVG, re-insert defs from main document
    canvas.insert(0,defs)
    # re-generate output
    svg = etree.tostring(output, pretty_print=False)

  if (output_format == 'tw'):
    # remove unnecessary attributes
    # TODO: never generate unnecessary attributes in the first place
    svg = svg.decode('utf-8')
    svg = regex_xmlns.sub('',svg)
    svg = svg.replace(' inkscape:connector-curvature="0"','') # this just saves space
    svg = svg.replace('\n','').replace('\r','') # print cannot be multi-line
    svg = regex_space.sub('><',svg) # remove indentaion
    svg = svg.replace('svg:','') # svg namespace was removed
    svg = svg.replace('<g ','<g transform="\'+_art_transform+\'"') # internal groups are used for scaling
    svg = svg.encode('utf-8')

  # save SVG string to file
  i = layer.get('id')
  output_path = os.path.join(output_directory,i+'.'+output_format)
  with open(output_path, 'wb') as f:
    if (output_format == 'svg'):
      # Header for normal SVG (XML)
      f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
      f.write(svg)
    elif (output_format == 'tw'):
      # Header for SVG in Twine file (SugarCube print statement)
      f.write((':: Art_Vector_%s [nobr]\n\n'%(i)).encode("utf-8"))
      f.write("<<print '<html>".encode("utf-8"))
      f.write(svg)
      f.write("</html>' >>".encode("utf-8"))


code:
#!/usr/bin/env python3

'''
Application for splitting groups from one SVG file into separate files

Usage:
python3 vector_layer_split.py infile format outdir

Usage Example:
python3 vector_layer_split.py vector_source.svg tw ../src/art/vector/layers/
'''

import lxml.etree as etree
from lxml.etree import XMLParser, parse

import sys
import os
import copy
import re
import normalize_svg

input_file = sys.argv[1]
output_format = sys.argv[2]
output_directory = sys.argv[3]

if not os.path.exists(output_directory):
    os.makedirs(output_directory)

ns = {
    'svg': 'http://www.w3.org/2000/svg',
    'inkscape': 'http://www.inkscape.org/namespaces/inkscape',
    'sodipodi': "http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",
}

p = XMLParser(huge_tree=True)
tree = parse(input_file, parser=p)
#tree = etree.parse(input_file)
normalize_svg.fix(tree)

# prepare output template
template = copy.deepcopy(tree)
root = template.getroot()

# remove all svg root attributes except document size
for a in root.attrib:
    if (a != "viewBox"):
        del root.attrib[a]

# add placeholder for CSS class (needed for workaround for non HTML 5.1 compliant browser)
if output_format == 'tw':
    root.attrib["class"] = "'+_art_display_class+'"

# remove all content, including metadata
# for twine output, style definitions are removed, too
defs = None
for e in root:
    if (e.tag == etree.QName(ns['svg'], 'defs')):
        defs = e
    if (e.tag == etree.QName(ns['svg'], 'g') or
            e.tag == etree.QName(ns['svg'], 'metadata') or
            e.tag == etree.QName(ns['svg'], 'defs') or
            e.tag == etree.QName(ns['sodipodi'], 'namedview') or
            (output_format == 'tw' and e.tag == etree.QName(ns['svg'], 'style'))
    ):
        root.remove(e)
# template preparation finished

# prepare regex for later use
regex_xmlns = re.compile(' xmlns[^ ]+', )
regex_space = re.compile('[>][ ]+[<]', )
regex_transformValue = re.compile('(?<=transformVariableName=")[^"]*', )
regex_transformVar = re.compile('transformVariableName="[^"]*"', )
regex_transformAttr = re.compile('transform="[^"]*"', )
# find all groups
layers = tree.xpath('//svg:g', namespaces=ns)
for layer in layers:
    i = layer.get('id')
    if (  # disregard non-content groups
            i.endswith("_") or  # manually suppressed with underscore
            i.startswith("XMLID") or  # Illustrator generated group
            i.startswith("g")  # Inkscape generated group
    ):
        continue
    # create new canvas
    output = copy.deepcopy(template)
    # copy all shapes into template
    canvas = output.getroot()
    for e in layer:
        canvas.append(e)
    # represent template as SVG (binary string)
    svg = etree.tostring(output, pretty_print=False)
    # poor man's conditional defs insertion
    # TODO: extract only referenced defs (filters, gradients, ...)
    # TODO: detect necessity by traversing the elements. do not stupidly search in the string representation
    if ("filter:" in svg.decode('utf-8')):
        # it seems there is a filter referenced in the generated SVG, re-insert defs from main document
        canvas.insert(0, defs)
        # re-generate output
        svg = etree.tostring(output, pretty_print=False)
    elif ("clip-path=" in svg.decode('utf-8')):
        # it seems there is a clip path referenced in the generated SVG, re-insert defs from main document
        canvas.insert(0, defs)
        # re-generate output
        svg = etree.tostring(output, pretty_print=False)

    if (output_format == 'tw'):
        # remove unnecessary attributes
        # TODO: never generate unnecessary attributes in the first place
        svg = svg.decode('utf-8')
        svg = regex_xmlns.sub('', svg)
        svg = svg.replace(' inkscape:connector-curvature="0"', '')  # this just saves space
        svg = svg.replace('\n', '').replace('\r', '')  # print cannot be multi-line
        svg = regex_space.sub('><', svg)  # remove indentaion
        svg = svg.replace('svg:', '')  # svg namespace was removed

        transformGroups = regex_transformVar.findall(svg)

        if (len(transformGroups) > 0):
            svg = regex_transformAttr.sub('', svg)
            for transformGroup in transformGroups:
                transformValue = regex_transformValue.search(transformGroup)
                if (transformValue is not None):
                    svg = svg.replace(transformGroup, ' transform="\'+' + transformValue.group() + '+\'" ')  # internal groups are used for scaling

        svg = svg.encode('utf-8')

    # save SVG string to file
    i = layer.get('id')
    output_path = os.path.join(output_directory, i + '.' + output_format)
    with open(output_path, 'wb') as f:
        if (output_format == 'svg'):
            # Header for normal SVG (XML)
            f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
            f.write(svg)
        elif (output_format == 'tw'):
            # Header for SVG in Twine file (SugarCube print statement)
            f.write((':: Art_Vector_Revamp_%s [nobr]\n\n' % (i)).encode("utf-8"))
            f.write("<<print '<html>".encode("utf-8"))
            f.write(svg)
            f.write("</html>' >>".encode("utf-8"))


code:
# Ignore everything in this directory
*
# Except the following:
!.gitignore


code:
#!/bin/bash

while [[ "$1" ]]
do
	case $1 in
	--insane)
		insane="true"
	;;
	*)
		echo "Unknown argument $1"
		exit 1
	esac
	shift
done

# Find and insert current commit
COMMIT=$(git rev-parse --short HEAD)
sed -Ei "s/build .releaseID/\0 commit $COMMIT/" src/gui/mainMenu/AlphaDisclaimer.tw

if [[ ! "$insane" ]]
then
	# Run sanity check.
	./sanityCheck
fi

ARCH="$(uname -m)"
if [ "$ARCH" = "x86_64" ]
then
	echo "x64 arch"
	./devTools/tweeGo/tweego_nix64 -o bin/FC_pregmod.html src/ || build_failed="true"
elif echo "$ARCH" | grep -Ee '86$' > /dev/null
then
	echo "x86 arch"
	./devTools/tweeGo/tweego_nix86 -o bin/FC_pregmod.html src/ || build_failed="true"
elif echo "$ARCH" | grep -Ee '^arm' > /dev/null
then
	echo "arm arch"
	# tweego doesn't provide arm binaries so you have to build it yourself
	export TWEEGO_PATH=devTools/tweeGo/storyFormats
	tweego -o bin/FC_pregmod.html src/ || build_failed="true"
else
	exit 2
fi

# Revert AlphaDisclaimer for next compilation
git checkout -- src/gui/mainMenu/AlphaDisclaimer.tw

if [ "$build_failed" = "true" ]
then
	exit 1
fi

#Make the output prettier, replacing \t with a tab and \n with a newline
sed -i -e '/^.*<div id="store-area".*$/s/\\t/\t/g' -e '/^.*<div id="store-area".*$/s/\\n/\n/g'  bin/FC_pregmod.html

path: compile