Skip to content

Commit

Permalink
Merge branch 'v0_8' of https://github.com/Inochi2D/inochi-creator int…
Browse files Browse the repository at this point in the history
…o paste-fix
  • Loading branch information
seagetch authored and seagetch committed Jan 1, 2024
2 parents 231d349 + 2ea10ba commit e2271fb
Show file tree
Hide file tree
Showing 21 changed files with 794 additions and 304 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: "Clone dependencies & set versions"
run: |
git clone https://github.com/Inochi2D/i2d-imgui.git --recurse-submodules
git clone https://github.com/Inochi2D/inochi2d.git
git clone -b v0_8 https://github.com/Inochi2D/inochi2d.git
git clone https://github.com/Inochi2D/dcv-i2d
dub add-local i2d-imgui/ "0.8.0"
dub add-local inochi2d/ "0.8.0"
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
- name: "Clone dependencies & set versions"
run: |
git clone https://github.com/Inochi2D/i2d-imgui.git --recurse-submodules
git clone https://github.com/Inochi2D/inochi2d.git
git clone -b v0_8 https://github.com/Inochi2D/inochi2d.git
git clone https://github.com/Inochi2D/dcv-i2d
dub add-local i2d-imgui/ "0.8.0"
dub add-local inochi2d/ "0.8.0"
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
- name: "Clone dependencies & set versions"
run: |
git clone https://github.com/Inochi2D/i2d-imgui.git --recurse-submodules
git clone https://github.com/Inochi2D/inochi2d.git
git clone -b v0_8 https://github.com/Inochi2D/inochi2d.git
git clone https://github.com/Inochi2D/dcv-i2d
dub add-local i2d-imgui/ "0.8.0"
dub add-local inochi2d/ "0.8.0"
Expand Down
120 changes: 62 additions & 58 deletions build-aux/osx/Info.plist
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Inochi Creator</string>
<key>CFBundleDisplayName</key>
<string>Inochi Creator</string>
<key>CFBundleIdentifier</key>
<string>com.inochi2d.inochi-creator</string>
<key>CFBundleVersion</key>
<string>0.7.4</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>inoc</string>
<key>CFBundleExecutable</key>
<string>inochi-creator</string>
<key>CFBundleIconFile</key>
<string>InochiCreator</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFile</key>
<string>project.icns</string>
<key>CFBundleTypeName</key>
<string>Inochi Creator Project</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.inochi2d.inochi-creator.project</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>com.inochi2d.inochi-creator.project</string>
<key>UTTypeReferenceURL</key>
<string>https://github.com/Inochi2D/inochi2d/wiki/INP-Data-Interchange-Format</string>
<key>UTTypeDescription</key>
<string>Inochi Creator Project</string>
<key>UTTypeIconFile</key>
<string>project.icns</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>inx</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
<dict>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>CFBundleShortVersionString</key>
<string>0.8.3</string>
<key>CFBundleName</key>
<string>Inochi Creator</string>
<key>CFBundleDisplayName</key>
<string>Inochi Creator</string>
<key>CFBundleIdentifier</key>
<string>com.inochi2d.InochiCreator</string>
<key>CFBundleVersion</key>
<string>0.8.3</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>inoc</string>
<key>CFBundleExecutable</key>
<string>inochi-creator</string>
<key>CFBundleIconFile</key>
<string>InochiCreator</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFile</key>
<string>project.icns</string>
<key>CFBundleTypeName</key>
<string>Inochi Creator Project</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.inochi2d.inochi-creator.project</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>com.inochi2d.inochi-creator.project</string>
<key>UTTypeReferenceURL</key>
<string>https://github.com/Inochi2D/inochi2d/wiki/INP-Data-Interchange-Format</string>
<key>UTTypeDescription</key>
<string>Inochi Creator Project</string>
<key>UTTypeIconFile</key>
<string>project.icns</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>inx</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
8 changes: 8 additions & 0 deletions build-aux/osx/InochiCreator.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion build-aux/osx/osxbundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi

# Create new directories and move dylibs
mkdir -p Frameworks SharedSupport Resources Resources/i18n
mv MacOS/libSDL2*.dylib Frameworks/libSDL2.dylib
mv MacOS/libSDL2-2.0.dylib Frameworks/libSDL2.dylib
mv -n MacOS/*.dylib Frameworks

# Move back to where we were
Expand Down
2 changes: 1 addition & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependency "bindbc-sdl" version="~>1.1.2"
dependency "dcv:core" version="~>0.3.0"
dependency "i18n-d" version="~>1.0.2"
dependency "i2d-imgui" version="~>0.8.0"
dependency "inochi2d" version="~>0.8.2"
dependency "inochi2d" version="~>0.8.3"
targetPath "out/"
workingDirectory "out/"
dflags "-mscrtlib=msvcrt" platform="windows-ldc"
Expand Down
Binary file modified res/ui/banner-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 68 additions & 11 deletions source/creator/actions/mesheditor.d
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ class MeshEditorAction(T) : LazyBoundAction {
mat4 oldEditorTransform = mat4.identity();
mat4 newEditorTransform = mat4.identity();
Parameter param;
vec2u keypoint;
vec2u oldKeypoint;
vec2u newKeypoint;

this(Node target, T action = null) {
this.target = target;
Expand All @@ -220,7 +221,7 @@ class MeshEditorAction(T) : LazyBoundAction {
if (auto lazyAction = cast(LazyBoundAction)action)
lazyAction.updateNewState();
if (self !is null) {
newEditorTransform = self.transform;
newKeypoint = param.findClosestKeypoint();
}
}

Expand All @@ -229,8 +230,8 @@ class MeshEditorAction(T) : LazyBoundAction {
target = null;
param = null;
} else {
param = incArmedParameter();
keypoint = param.findClosestKeypoint();
param = incArmedParameter();
oldKeypoint = param.findClosestKeypoint();
oldEditorTransform = self.transform;
}
if (auto lazyAction = cast(LazyBoundAction)action)
Expand All @@ -246,12 +247,17 @@ class MeshEditorAction(T) : LazyBoundAction {
*/
void rollback() {
if (action !is null) {
if (self !is null) {
param.pushIOffset(param.getKeypointValue(newKeypoint), ParamMergeMode.Forced);
}
action.rollback();
if (isApplyable()) {
self.transform = oldEditorTransform;
}
if (self !is null)
if (self !is null) {
param.pushIOffset(param.getKeypointValue(oldKeypoint), ParamMergeMode.Forced);
self.forceResetAction();
}
}
}

Expand All @@ -261,11 +267,16 @@ class MeshEditorAction(T) : LazyBoundAction {
void redo() {
if (action !is null) {
action.redo();
if (self !is null) {
param.pushIOffset(param.getKeypointValue(oldKeypoint), ParamMergeMode.Forced);
}
if (isApplyable()) {
self.transform = newEditorTransform;
}
if (self !is null)
if (self !is null) {
param.pushIOffset(param.getKeypointValue(newKeypoint), ParamMergeMode.Forced);
self.forceResetAction();
}
}
}

Expand Down Expand Up @@ -328,9 +339,19 @@ public:
SplinePoint[] newTargetPathPoints;
vec2[] oldInitTangents;
vec2[] newInitTangents;
vec3[] oldRefOffsets;
vec3[] newRefOffsets;
ulong[] oldSelected;
ulong[] newSelected;
vec2[] oldDeformation;
vec2[] newDeformation;
float oldOrigX, oldOrigY, oldOrigRotZ;
float newOrigX, newOrigY, newOrigRotZ;

IncMeshEditorOneDrawableDeform selfDeform() {
return cast(IncMeshEditorOneDrawableDeform)self();
}

auto path() {
if (self !is null)
return self.getPath();
Expand All @@ -343,16 +364,27 @@ public:
if (path !is null) {
oldPathPoints = path.points.dup;
oldInitTangents = path.initTangents.dup;
oldRefOffsets = path.refOffsets.dup;
oldOrigX = path.origX;
oldOrigY = path.origY;
oldOrigRotZ = path.origRotZ;
} else {
oldPathPoints = null;
oldInitTangents = null;
oldRefOffsets = null;
oldOrigX = 0;
oldOrigY = 0;
oldOrigRotZ = 0;
}
if (self !is null) {
oldSelected = self.selected;
if (selfDeform !is null)
oldDeformation = selfDeform.deformation;
} else {
oldSelected = null;
oldDeformation = null;
}

if (this.path && this.path.target !is null)
oldTargetPathPoints = this.path.target.points.dup;
else
Expand All @@ -368,6 +400,12 @@ public:
newOrigX = path.origX;
newOrigY = path.origY;
newOrigRotZ = path.origRotZ;
newRefOffsets = path.refOffsets.dup;
}
if (self !is null) {
newSelected = self.selected;
if (selfDeform !is null)
newDeformation = selfDeform.deformation;
}
if (path !is null && path.target !is null)
newTargetPathPoints = path.target.points.dup;
Expand All @@ -379,6 +417,7 @@ public:
if (path !is null) {
oldPathPoints = path.points.dup;
oldInitTangents = path.initTangents.dup;
oldRefOffsets = path.refOffsets.dup;
oldOrigX = path.origX;
oldOrigY = path.origY;
oldOrigRotZ = path.origRotZ;
Expand All @@ -389,6 +428,12 @@ public:
oldOrigY = 0;
oldOrigRotZ = 0;
}
if (self !is null) {
oldSelected = self.selected;
if (selfDeform !is null)
oldDeformation = selfDeform.deformation;
}
else oldSelected = null;
if (path !is null && path.target !is null)
oldTargetPathPoints = path.target.points.dup;
else
Expand All @@ -407,11 +452,17 @@ public:
if (oldPathPoints !is null && oldPathPoints.length > 0 && path !is null) {
path.points = oldPathPoints.dup;
path.initTangents = oldInitTangents.dup;
path.refOffsets = oldRefOffsets.dup;
path.origX = oldOrigX;
path.origY = oldOrigY;
path.origRotZ = oldOrigRotZ;
path.update(); /// FIX ME: we need to recreate path object if needed.
}
if (oldSelected !is null) {
self.selected = oldSelected.dup;
}
if (oldDeformation !is null)
selfDeform.deformation = oldDeformation.dup;
if (oldTargetPathPoints !is null && oldTargetPathPoints.length > 0 && path !is null && path.target !is null) {
path.target.points = oldTargetPathPoints.dup;
path.target.update(); /// FIX ME: we need to recreate path object if needed.
Expand All @@ -425,18 +476,24 @@ public:
override
void redo() {
super.redo();
if (isApplyable()) {
if (isApplyable()) {
if (newPathPoints !is null && newPathPoints.length > 0 && path !is null) {
this.path.points = newPathPoints.dup;
path.points = newPathPoints.dup;
path.initTangents = newInitTangents.dup;
path.refOffsets = newRefOffsets.dup;
path.origX = newOrigX;
path.origY = newOrigY;
path.origRotZ = newOrigRotZ;
this.path.update();
path.update();
}
if (newSelected !is null) {
self.selected = newSelected.dup;
}
if (newDeformation !is null)
selfDeform.deformation = newDeformation.dup;
if (newTargetPathPoints !is null && newTargetPathPoints.length > 0 && path !is null && path.target !is null) {
this.path.target.points = newTargetPathPoints.dup;
this.path.target.update();
path.target.points = newTargetPathPoints.dup;
path.target.update();
}
}
}
Expand Down
Loading

0 comments on commit e2271fb

Please sign in to comment.