Skip to content

Commit

Permalink
Optimization (#12)
Browse files Browse the repository at this point in the history
* Changing to SOA with a proxy

* notes

* Modules

* submodule

* upgrading

* Reset submodule

* Reset submodule

* MMAnimationPlayer output global kform

* Added kform, bones models vel is calculated

* Root motion correctly applied, need integrations

* Root Motion is now working

* RootMotion now inertialize correctly

* Saving

* MMAnimationLibrary now a resource

* Able to bake with root and bones.

* new serialize series of functions

* Query pose added.

Needs to show how to use it.

* Problem with serialize bones

* Add serialize function that might be helpful

* updated the plugin

* Choosing animation

* LAtest changes, mostly editor

* Preparing for merge

* Added Icons

* import gitignore

* Added Icons, prepared for Godot 4.2

* Cleaning

* Saving before fix lag

* Removed bug

* Update build-addons.yml to trigger the workflow on push events for the "main" branch.

So I can test the latest without a pull request.

* Fixed bug

* Added Motion Scale to Root Vel

* Default halflife, request_pose, motion scale

* updated godot_cpp to master

* Fix a few issues shown in CICD

* Exceptions handling

* code use exception, so enable it

* Include cmath for log

* logf is c99, and removed some warnings

* fixes

* Fix Mac

* fix mac

* ubuntu latest

* Reduce in ubuntu's g++ doesn't like multitypes.

* Removed LocalDistanceToPoint

* Removed error with motion_scale

* Allow exception for now because of kdtree

* I hope it work damn it

* exceptions

* This is it

* Removed Weight Percentage Calculation.

While useful in theory, this make the process of having precise numbers more difficult.

* Removed Throw for fno-exceptions

---------

Co-authored-by: Remi Drolet <rdrolet@qube-4d.com>
  • Loading branch information
fire and Remi Drolet authored Nov 2, 2023
1 parent 4c60515 commit 3836276
Show file tree
Hide file tree
Showing 30 changed files with 2,011 additions and 650 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-addons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- identifier: linux-debug
os: ubuntu-latest
name: 🐧 Linux Debug
runner: ubuntu-20.04
runner: ubuntu-22.04
target: template_debug
platform: linux
arch: x86_64
Expand All @@ -68,7 +68,7 @@ jobs:
- identifier: linux-release
os: ubuntu-latest
name: 🐧 Linux Release
runner: ubuntu-20.04
runner: ubuntu-22.04
target: template_release
platform: linux
arch: x86_64
Expand Down Expand Up @@ -144,6 +144,7 @@ jobs:

- name: Compile Addon
run: scons
disable_exceptions=false
platform=${{ matrix.platform }}
target=${{ matrix.target }}
arch=${{ matrix.arch }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Import settings
*.import

# Prerequisites
*.d

Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "godot-cpp"]
path = godot-cpp
url = https://github.com/godotengine/godot-cpp.git
branch = 4.1
branch = master
42 changes: 21 additions & 21 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@ from pathlib import Path
import fnmatch
import os

# Initial options inheriting from CLI args
opts = Variables([], ARGUMENTS)
# Define options
opts.Add("Boost_INCLUDE_DIR", "boost library include path", "")
opts.Add("Boost_LIBRARY_DIRS", "boost library library path", "")

try:
env = Environment()
print(env.ARGUMENTS)
except:
# Default tools with no platform defaults to gnu toolchain.
# We apply platform specific toolchains via our custom tools.
env = Environment(tools=["default"], PLATFORM="")

# TODO: Do not copy environment after godot-cpp/test is updated <https://github.com/godotengine/godot-cpp/blob/master/test/SConstruct>.
env = SConscript("godot-cpp/SConstruct")
opts.Update(env)
env = SConscript("godot-cpp/SConstruct",'env')

# Add Included files files.

# Initial options inheriting from CLI args
opts = Variables([], ARGUMENTS)
opts.Add("Boost_INCLUDE_DIR", "boost library include path", "")
opts.Add("Boost_LIBRARY_DIRS", "boost library library path", "")
opts.Update(env)
boost_path = Dir(env['Boost_INCLUDE_DIR'])

# Add Included files.
env.Append(CPPPATH=["src/","thirdparty/",boost_path])

sources = []
Expand All @@ -42,25 +49,18 @@ addon_path = "addons/MotionMatching/"
project_name = "MotionMatching"

# TODO: Cache is disabled currently.
# scons_cache_path = os.environ.get("SCONS_CACHE")
# if scons_cache_path != None:
# CacheDir(scons_cache_path)
# print("Scons cache enabled... (path: '" + scons_cache_path + "')")

# Create the library target (e.g. libexample.linux.debug.x86_64.so).
debug_or_release = ""
if env["target"] == "release" or env["target"] == "template_release":
debug_or_release = "template_release"
else:
debug_or_release = "template_debug"
scons_cache_path = os.environ.get("SCONS_CACHE")
if scons_cache_path != None:
CacheDir(scons_cache_path)
print("Scons cache enabled... (path: '" + scons_cache_path + "')")


if env["platform"] == "macos":
library = env.SharedLibrary(
addon_path + "bin/lib{0}.{1}.{2}.framework/{0}.{1}.{2}".format(
project_name,
env["platform"],
debug_or_release,
env["target"],
),
source=sources,
)
Expand All @@ -69,7 +69,7 @@ else:
addon_path + "bin/lib{}.{}.{}.{}{}".format(
project_name,
env["platform"],
debug_or_release,
env["target"],
env["arch"],
env["SHLIBSUFFIX"],
),
Expand Down
64 changes: 32 additions & 32 deletions addons/MotionMatching/MMEditorGizmoPlugin.gd
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
@tool
# @tool

class_name MMEditorGizmoPlugin extends EditorNode3DGizmoPlugin
# class_name MMEditorGizmoPlugin extends EditorNode3DGizmoPlugin

class MMGizmo extends EditorNode3DGizmo:
var gizmo_size = 3.0
var lines := PackedVector3Array()
# class MMGizmo extends EditorNode3DGizmo:
# var gizmo_size = 3.0
# var lines := PackedVector3Array()

func _redraw():
clear()
var node3d = get_node_3d()
# func _redraw():
# clear()
# var node3d = get_node_3d()

var instance : MMGizmo = null
# var instance : MMGizmo = null

func _init():
create_material("white", Color.WHITE)
create_material("blue", Color.BLUE)
create_material("red", Color.RED)
create_material("green", Color.GREEN)
create_material("orange", Color.ORANGE_RED)
# func _init():
# create_material("white", Color.WHITE)
# create_material("blue", Color.BLUE)
# create_material("red", Color.RED)
# create_material("green", Color.GREEN)
# create_material("orange", Color.ORANGE_RED)

prints("MMEditorGizmoPlugin")
# prints("MMEditorGizmoPlugin")

func _create_gizmo(node):
if node is Skeleton3D:
if instance == null:
instance = MMGizmo.new()
return instance
else:
return null
# func _create_gizmo(node):
# if node is Skeleton3D:
# if instance == null:
# instance = MMGizmo.new()
# return instance
# else:
# return null

func _get_gizmo_name() -> String:
return "MMGizmo"
# func _get_gizmo_name() -> String:
# return "MMGizmo"

func set_lines(lines:PackedVector3Array):
instance.lines = lines
instance._redraw()
# func set_lines(lines:PackedVector3Array):
# instance.lines = lines
# instance._redraw()


func _has_gizmo(node):
return node.name is Skeleton3D
# func _has_gizmo(node):
# return node.name is Skeleton3D


func _redraw(gizmo : EditorNode3DGizmo):
pass
# func _redraw(gizmo : EditorNode3DGizmo):
# pass

Loading

0 comments on commit 3836276

Please sign in to comment.