From a7998a420b7e59d8278836c1c3cfaecd24447d73 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 2 Dec 2024 15:19:06 +0000 Subject: [PATCH 1/3] Fix news/new typo in BufferGeometry --- lib/mittsu/core/buffer_geometry.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mittsu/core/buffer_geometry.rb b/lib/mittsu/core/buffer_geometry.rb index 76022da..3726b59 100644 --- a/lib/mittsu/core/buffer_geometry.rb +++ b/lib/mittsu/core/buffer_geometry.rb @@ -647,7 +647,7 @@ def to_json end def clone - geometry = Mittsu::BufferGeometry.news + geometry = Mittsu::BufferGeometry.new @attributes.each do |key, attribute| geometry[key] = attribute.clone From 4132e04e48184ebb7ff95da29b405b4ef3ae04aa Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 2 Dec 2024 15:20:13 +0000 Subject: [PATCH 2/3] Not all geometries have morph_targets --- lib/mittsu/objects/mesh.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/mittsu/objects/mesh.rb b/lib/mittsu/objects/mesh.rb index e54fa5d..e435ed1 100644 --- a/lib/mittsu/objects/mesh.rb +++ b/lib/mittsu/objects/mesh.rb @@ -16,6 +16,7 @@ def initialize(geometry = Geometry.new, material = MeshBasicMaterial.new(color: end def update_morph_targets + return unless @geometry.respond_to?(:morph_targets) if !@geometry.morph_targets.nil? && !@geometry.morph_targets.empty? @morph_targets_base = -1 @morph_target_forced_order = [] From e4182c0b92e94e17c45e015a9439f395774efb3f Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 2 Dec 2024 19:39:23 +0000 Subject: [PATCH 3/3] fix incorrectly-nested method --- lib/mittsu/objects/mesh.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/mittsu/objects/mesh.rb b/lib/mittsu/objects/mesh.rb index e435ed1..45cc944 100644 --- a/lib/mittsu/objects/mesh.rb +++ b/lib/mittsu/objects/mesh.rb @@ -17,6 +17,7 @@ def initialize(geometry = Geometry.new, material = MeshBasicMaterial.new(color: def update_morph_targets return unless @geometry.respond_to?(:morph_targets) + if !@geometry.morph_targets.nil? && !@geometry.morph_targets.empty? @morph_targets_base = -1 @morph_target_forced_order = [] @@ -27,14 +28,14 @@ def update_morph_targets @morph_targets_influences << 0 @morph_targets_dictionary[target.name] = m end + end - def morph_target_index_by_name(name) - morph_target_index = @morph_targets_dictionary[name] - return morph_target_index unless morph_target_index.nil? + def morph_target_index_by_name(name) + morph_target_index = @morph_targets_dictionary[name] + return morph_target_index unless morph_target_index.nil? - puts "WARNING: Mittsu::Mest#morph_target_index_by_name: morph target #{name} does not exist. Returning 0." - 0 - end + puts "WARNING: Mittsu::Mesh#morph_target_index_by_name: morph target #{name} does not exist. Returning 0." + 0 end end