Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous bugfixes #134

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mittsu/core/buffer_geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions lib/mittsu/objects/mesh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def initialize(geometry = Geometry.new, material = MeshBasicMaterial.new(color:
end

def update_morph_targets
return unless @geometry.respond_to?(:morph_targets)

if [email protected]_targets.nil? && [email protected]_targets.empty?
@morph_targets_base = -1
@morph_target_forced_order = []
Expand All @@ -26,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

Expand Down
Loading