forked from ajc27-git/freemocap_tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into development
- Loading branch information
Showing
28 changed files
with
316 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
...reemocap_blender_addon/core_functions/meshes/center_of_mass/create_center_of_mass_mesh.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import numpy as np | ||
import bpy | ||
|
||
def create_center_of_mass_mesh(center_of_mass_xyz:np.ndarray, | ||
center_of_mass_empty: bpy.types.Object): | ||
# Create a mesh object for the center of mass, with a default sphere mesh that is a sphere with radius .05 and a material that is a "checkboard" pattern with a scale of 2.0 and colors that are Blue and Yellow | ||
bpy.ops.mesh.primitive_uv_sphere_add(radius=0.05, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1)) | ||
center_of_mass_mesh = bpy.context.active_object | ||
center_of_mass_mesh.name = "center_of_mass_mesh" | ||
center_of_mass_mesh.data.name = "center_of_mass_mesh_data" | ||
center_of_mass_mesh.location = center_of_mass_xyz | ||
center_of_mass_mesh.parent = center_of_mass_empty | ||
|
||
# Create a material for the center of mass mesh | ||
bpy.ops.material.new(name="center_of_mass_material") | ||
material = bpy.data.materials["center_of_mass_material"] | ||
material.use_nodes = True | ||
# Get the material nodes | ||
nodes = material.node_tree.nodes | ||
# Remove the default 'Principled BSDF' | ||
nodes.remove(nodes['Principled BSDF']) | ||
# Create a new 'Checker Texture' node | ||
checker_node = nodes.new(type='ShaderNodeTexChecker') | ||
|
||
|
||
|
||
|
2 changes: 2 additions & 0 deletions
2
...emocap_blender_addon/core_functions/meshes/center_of_mass/create_center_of_mass_trails.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def create_center_of_mass_trails(center_of_mass_xyz, center_of_mass_empty): | ||
pass |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.