Skip to content

Commit 953818e

Browse files
committed
more corrections
1 parent 2b0eeb7 commit 953818e

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

DenizenModelsConverter/BBModel.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public class Element
5151

5252
public Face North, South, East, West, Up, Down;
5353

54+
public Outliner Outline;
55+
5456
public class Face
5557
{
5658
public int TextureID;
@@ -103,7 +105,9 @@ public class Animation
103105

104106
public enum LoopType
105107
{
106-
LOOP, ONCE
108+
LOOP,
109+
ONCE,
110+
HOLD
107111
}
108112

109113
public LoopType Loop;
@@ -148,7 +152,8 @@ public enum ChannelType
148152
public enum InterpolationType
149153
{
150154
LINEAR,
151-
CATMULLROM
155+
CATMULLROM, // AKA "Smooth"
156+
STEP
152157
}
153158

154159
public InterpolationType Interpolation;

DenizenModelsConverter/BBModelReader.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,15 @@ public static void AddOutlineChild(BBModel model, BBModel.Outliner outline, JTok
209209
}
210210
throw new Exception($"Cannot find required element {id} for outline {outline.Name}");
211211
}
212-
if (AcceptableRotations.Contains(element.Rotation.X) && AcceptableRotations.Contains(element.Rotation.Y) && AcceptableRotations.Contains(element.Rotation.Z))
212+
if (element.Outline is not null)
213+
{
214+
throw new Exception($"Cannot add required element {id} for outline {outline.Name} because it is already in other outline {element.Outline.Name}");
215+
}
216+
if (AcceptableRotations.Contains(element.Rotation.X) && AcceptableRotations.Contains(element.Rotation.Y) && AcceptableRotations.Contains(element.Rotation.Z)
217+
&& ((element.Rotation.X == 0 ? 0 : 1) + (element.Rotation.Y == 0 ? 0 : 1) + (element.Rotation.Z == 0 ? 0 : 1)) < 2)
213218
{
214219
outline.Children.Add(id);
220+
element.Outline = outline;
215221
}
216222
else
217223
{
@@ -224,6 +230,7 @@ public static void AddOutlineChild(BBModel model, BBModel.Outliner outline, JTok
224230
};
225231
element.Rotation = new DoubleVector();
226232
element.Origin = new DoubleVector();
233+
element.Outline = specialSideOutline;
227234
specialSideOutline.Children.Add(element.UUID);
228235
model.Outlines.Add(specialSideOutline);
229236
outline.Paired.Add(specialSideOutline.UUID);

DenizenModelsConverter/MinecraftModelMaker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public static string CreateModelFor(BBModel model, BBModel.Outliner outline)
3434
any = true;
3535
JObject jElement = new();
3636
jElement.Add("name", element.Name);
37-
jElement.Add("from", DVecToArray(element.From));
38-
jElement.Add("to", DVecToArray(element.To));
37+
jElement.Add("from", DVecToArray(element.From - outline.Origin));
38+
jElement.Add("to", DVecToArray(element.To - outline.Origin));
3939
JObject rotation = new();
4040
rotation.Add("origin", DVecToArray(element.Origin));
4141
if (element.Rotation.X != 0)

0 commit comments

Comments
 (0)