Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CloneTrooper1019 authored and CloneTrooper1019 committed Feb 15, 2018
1 parent 9e592dc commit 6b2bc9e
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 58 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*/bin/*
*/obj/*
packages/*
*.suo
*.suo
*.user
*.ide
Binary file modified Rbx2Source.exe
Binary file not shown.
15 changes: 13 additions & 2 deletions src/Assembler/R15CharacterAssembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public StudioMdlWriter AssembleModel(Folder characterAssets, AvatarScale scale)
{
Instance existing = assembly.FindFirstChild(asset.Name);
if (existing != null) existing.Destroy();
Part part = (Part)asset;
asset.Parent = assembly;
}
else if (asset.IsA("Accoutrement"))
Expand Down Expand Up @@ -110,8 +111,18 @@ public TextureAssembly AssembleTextures(UserAvatar avatar, Dictionary<string,Mat
assembly.Images = new Dictionary<string, Image>();
assembly.MatLinks = new Dictionary<string, string>();

string uvMapUrl = TextureFetch.FromUser(avatar.UserInfo.Id)[0];
Bitmap uvMap = RbxWebUtility.DownloadImage(uvMapUrl);
// Figure out which image is the uvMap
Bitmap uvMap = null;
foreach (string uvMapUrl in TextureFetch.FromUser(avatar.UserInfo.Id))
{
Bitmap possibleUvMap = RbxWebUtility.DownloadImage(uvMapUrl);
if (possibleUvMap.Width == 1024 && possibleUvMap.Height == 1024)
{
uvMap = possibleUvMap;
break;
}
}

ImageAttributes blankAtt = new ImageAttributes();

foreach (string materialName in materials.Keys)
Expand Down
12 changes: 6 additions & 6 deletions src/Forms/Rbx2Source.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Forms/Rbx2Source.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private bool TrySetAssetId(object value)
}
catch
{
showError("This AssetId isn't configured correctly on ROBLOX's end.\n\nThis error usually happens if you input a very old AssetId that doesn't exist on their servers.\n\nTry something else!");
showError("This AssetId isn't configured correctly on Roblox's end.\n\nThis error usually happens if you input a very old AssetId that doesn't exist on their servers.\n\nTry something else!");
}
if (asset != null)
{
Expand Down Expand Up @@ -372,7 +372,7 @@ private async void LogException(Task brokenTask, string context)
if (exception != null)
{
exceptionMsg = exception.Message;
errorMsg += "\nError Message: " + exceptionMsg + "\n\nIf this error message has happened multiple times, and doesn't seem deliberate, you should totally send a screenshot of this error message to @MaxGee1019 on Twitter.\n\nSTACK TRACE:\n" + dumbHeaderLineThing + "\n" + exception.StackTrace + "\n" + dumbHeaderLineThing;
errorMsg += "\nError Message: " + exceptionMsg + "\n\nIf this error message has happened multiple times, and doesn't seem deliberate, you should totally send a screenshot of this error message to @MaxGeee1019 on Twitter.\n\nSTACK TRACE:\n" + dumbHeaderLineThing + "\n" + exception.StackTrace + "\n" + dumbHeaderLineThing;
}
}

Expand Down Expand Up @@ -631,7 +631,7 @@ private void Rbx2Source_Load(object sender, EventArgs e)

Links = new Dictionary<Control, string>()
{
{twitterLink, "https://www.twitter.com/MaxGee1019"},
{twitterLink, "https://www.twitter.com/MaxGeee1019"},
{AJLink, "https://www.github.com/RedInquisitive"},
{egoMooseLink, "https://www.github.com/EgoMoose"},
{nemsTools, "http://nemesis.thewavelength.net/index.php?p=40"}
Expand Down
12 changes: 11 additions & 1 deletion src/Forms/Rbx2Source.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2527,7 +2527,17 @@
</value>
</data>
<data name="changeLogBox.Text" xml:space="preserve">
<value>[v2.07] (June 4th, 2017)
<value>[v2.08] (February 15th, 2018)
• Fixed a bug where the R15 texture assembler
wasn't using the right texture.
• Fixed a bug where invisible limbs would be generated
when using R15 package limbs, like the peg leg.
• Replaced spellings of "ROBLOX" with "Roblox".
• Switched my @MaxGee1019 handle over to
@MaxGeee1019 in the program credits
(because Twitter sucks &lt;3)
______________________________________________________
[v2.07] (June 4th, 2017)
• Refactored a lot of the model compiler code,
so models should compile MUCH faster now.
• Rewrote the asset fetcher so that it properly caches
Expand Down
88 changes: 48 additions & 40 deletions src/Geometry/Mesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,59 +206,67 @@ public static Mesh BakePart(Part part, Material material = null)
material.Reflectance = part.Reflectance;
}

if (part.IsA("MeshPart"))
if (part.Transparency < 1)
{
MeshPart meshPart = (MeshPart)part;
if (meshPart.MeshID == null)
if (part.IsA("MeshPart"))
{
string partName = meshPart.Name;
if (StandardLimbs.ContainsKey(partName))
meshAsset = StandardLimbs[partName];
}
else meshAsset = Asset.GetByAssetId(meshPart.MeshID);
MeshPart meshPart = (MeshPart)part;
if (meshPart.MeshID == null)
{
string partName = meshPart.Name;
if (StandardLimbs.ContainsKey(partName))
meshAsset = StandardLimbs[partName];
}
else meshAsset = Asset.GetByAssetId(meshPart.MeshID);

if (meshPart.TextureID != null)
textureAsset = Asset.GetByAssetId(meshPart.TextureID);

scale = meshPart.Size / meshPart.InitialSize;
offset = part.CFrame;
}
else
{
offset = part.CFrame;
if (meshPart.TextureID != null)
textureAsset = Asset.GetByAssetId(meshPart.TextureID);

DataModelMesh legacy = (DataModelMesh)part.FindFirstChildOfClass("DataModelMesh");
if (legacy != null)
scale = meshPart.Size / meshPart.InitialSize;
offset = part.CFrame;
}
else
{
scale = legacy.Scale;
offset *= new CFrame(legacy.Offset);
offset = part.CFrame;

if (material != null)
material.VertexColor = legacy.VertexColor;

if (legacy.IsA("SpecialMesh"))
DataModelMesh legacy = (DataModelMesh)part.FindFirstChildOfClass("DataModelMesh");
if (legacy != null)
{
SpecialMesh specialMesh = (SpecialMesh)legacy;
if (specialMesh.MeshType == MeshType.Head)
meshAsset = Asset.FromResource("Meshes/StandardLimbs/head.mesh");
else
meshAsset = Asset.GetByAssetId(specialMesh.MeshId);

if (specialMesh.TextureId != null)
textureAsset = Asset.GetByAssetId(specialMesh.TextureId);
}
scale = legacy.Scale;
offset *= new CFrame(legacy.Offset);

else if (legacy.IsA("CylinderMesh"))
{
CylinderMesh cylinderMesh = (CylinderMesh)legacy;
if (cylinderMesh.UsingSuperAwkwardHeadProtocol)
if (material != null)
material.VertexColor = legacy.VertexColor;

if (legacy.IsA("SpecialMesh"))
{
SpecialMesh specialMesh = (SpecialMesh)legacy;
if (specialMesh.MeshType == MeshType.Head)
meshAsset = Asset.FromResource("Meshes/StandardLimbs/head.mesh");
else
meshAsset = Asset.GetByAssetId(specialMesh.MeshId);

if (specialMesh.TextureId != null)
textureAsset = Asset.GetByAssetId(specialMesh.TextureId);
}

else if (legacy.IsA("CylinderMesh"))
{
meshAsset = Asset.FromResource("Meshes/Heads/" + cylinderMesh.HeadAssetName + ".mesh");
scale = new Vector3(1, 1, 1);
CylinderMesh cylinderMesh = (CylinderMesh)legacy;
if (cylinderMesh.UsingSuperAwkwardHeadProtocol)
{
meshAsset = Asset.FromResource("Meshes/Heads/" + cylinderMesh.HeadAssetName + ".mesh");
scale = new Vector3(1, 1, 1);
}
}
}
}
}
else
{
// Just give it a blank mesh to eat for now.
result = new Mesh();
}

if (meshAsset != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rbx2Source")]
[assembly: AssemblyDescription("A utility tool that automatically assembles ROBLOX assets into geometry data, which is then compiled into the Source Engine.")]
[assembly: AssemblyDescription("A utility tool that automatically assembles Roblox assets into geometry data, which is then compiled into the Source Engine.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Rbx2Source")]
Expand Down
7 changes: 6 additions & 1 deletion src/Rbx2Source.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>true</UseVSHostingProcess>
<RunCodeAnalysis>true</RunCodeAnalysis>
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -163,6 +164,7 @@
</EmbeddedResource>
<EmbeddedResource Include="Forms\Rbx2Source.resx">
<DependentUpon>Rbx2Source.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\AvatarData\R15\Animations\Climb.rbxmx" />
<EmbeddedResource Include="Resources\AvatarData\R15\Animations\Idle.rbxmx" />
Expand Down Expand Up @@ -248,6 +250,9 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy /y $(TargetDir)$(TargetFileName) $(ProjectDir)..\$(TargetFileName)</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 1 addition & 1 deletion src/Reflection/Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Rbx2Source.Reflection
{
/// <summary>
/// Lazy implementation of ROBLOX's Instance functionality.
/// Lazy implementation of Roblox's Instance functionality.
/// </summary>

class Instance
Expand Down
2 changes: 1 addition & 1 deletion src/Web/RbxWebUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static string PendCdnUrl(string url, bool log = true)
if (log) Rbx2Source.Print("\tWaiting for finalization of " + url + dots);
wait(1f);
if (dots.Length > 13)
throw new Exception("RbxCdnPender timed out after 10 retries!\nROBLOX's server's may be overloaded right now.\nTry again after a few minutes!");
throw new Exception("RbxCdnPender timed out after 10 retries!\nRoblox's server's may be overloaded right now.\nTry again after a few minutes!");
}
}
return result;
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.07
2.08

0 comments on commit 6b2bc9e

Please sign in to comment.