Browse Source

Squashed commit of the following:

commit 8b67f0edcb9b588c70df1676bdbfa4853e50c3aa
Author: Lumak <[email protected]>
Date:   Thu Dec 29 10:18:40 2016 -0800

    corrected to stonetiled mat

commit c17d68b1e0ed5435c492a26ed8010c4f4aa708eb
Author: Lumak <[email protected]>
Date:   Thu Dec 29 10:14:20 2016 -0800

    removed proto mat/texture

commit 1c322d19556d7796c4958a920203e5b1c80af843
Author: Lumak <[email protected]>
Date:   Wed Dec 28 12:18:59 2016 -0800

    replaced the Jack with Jill in 06_SkeletalAnimation sample
Lasse Öörni 9 years ago
parent
commit
299dbf803b

+ 1 - 1
Source/Samples/06_SkeletalAnimation/Mover.cpp

@@ -55,7 +55,7 @@ void Mover::Update(float timeStep)
 
     // Get the model's first (only) animation state and advance its time. Note the convenience accessor to other components
     // in the same scene node
-    AnimatedModel* model = GetComponent<AnimatedModel>();
+    AnimatedModel* model = node_->GetComponent<AnimatedModel>(true);
     if (model->GetNumAnimationStates())
     {
         AnimationState* state = model->GetAnimationStates()[0];

+ 12 - 6
Source/Samples/06_SkeletalAnimation/SkeletalAnimation.cpp

@@ -115,24 +115,30 @@ void SkeletalAnimation::CreateScene()
 
     // Create animated models
     const unsigned NUM_MODELS = 100;
-    const float MODEL_MOVE_SPEED = 2.0f;
+    const float MODEL_MOVE_SPEED = 4.0f;
     const float MODEL_ROTATE_SPEED = 100.0f;
     const BoundingBox bounds(Vector3(-47.0f, 0.0f, -47.0f), Vector3(47.0f, 0.0f, 47.0f));
 
     for (unsigned i = 0; i < NUM_MODELS; ++i)
     {
-        Node* modelNode = scene_->CreateChild("Jack");
+        Node* modelNode = scene_->CreateChild("Jill");
         modelNode->SetPosition(Vector3(Random(90.0f) - 45.0f, 0.0f, Random(90.0f) - 45.0f));
         modelNode->SetRotation(Quaternion(0.0f, Random(360.0f), 0.0f));
-        AnimatedModel* modelObject = modelNode->CreateComponent<AnimatedModel>();
-        modelObject->SetModel(cache->GetResource<Model>("Models/Jack.mdl"));
-        modelObject->SetMaterial(cache->GetResource<Material>("Materials/Jack.xml"));
+
+        Node* spinNode = modelNode->CreateChild();
+        spinNode->SetRotation(Quaternion(180.0f, Vector3(0.0f, 1.0f, 0.0f)));
+
+        AnimatedModel* modelObject = spinNode->CreateComponent<AnimatedModel>();
+
+        modelObject->SetModel(cache->GetResource<Model>("Models/Kachujin/Kachujin.mdl"));
+        modelObject->SetMaterial(cache->GetResource<Material>("Models/Kachujin/Materials/Kachujin.xml"));
         modelObject->SetCastShadows(true);
 
         // Create an AnimationState for a walk animation. Its time position will need to be manually updated to advance the
         // animation, The alternative would be to use an AnimationController component which updates the animation automatically,
         // but we need to update the model's position manually in any case
-        Animation* walkAnimation = cache->GetResource<Animation>("Models/Jack_Walk.ani");
+        Animation* walkAnimation = cache->GetResource<Animation>("Models/Kachujin/Kachujin_Run.ani");
+
         AnimationState* state = modelObject->AddAnimationState(walkAnimation);
         // The state would fail to create (return null) if the animation was not found
         if (state)

+ 11 - 7
bin/Data/LuaScripts/06_SkeletalAnimation.lua

@@ -64,23 +64,27 @@ function CreateScene()
 
     -- Create animated models
     local uint NUM_MODELS = 100
-    local MODEL_MOVE_SPEED = 2.0
+    local MODEL_MOVE_SPEED = 4.0
     local MODEL_ROTATE_SPEED = 100.0
     local bounds = BoundingBox(Vector3(-47.0, 0.0, -47.0), Vector3(47.0, 0.0, 47.0))
 
     for i = 1, NUM_MODELS do
-        local modelNode = scene_:CreateChild("Jack")
+        local modelNode = scene_:CreateChild("Jill")
         modelNode.position = Vector3(Random(90.0) - 45.0, 0.0, Random(90.0) - 45.0)
         modelNode.rotation = Quaternion(0.0, Random(360.0), 0.0)
-        local modelObject = modelNode:CreateComponent("AnimatedModel")
-        modelObject.model = cache:GetResource("Model", "Models/Jack.mdl")
-        modelObject.material = cache:GetResource("Material", "Materials/Jack.xml")
+
+        localspinNode = modelNode:CreateChild();
+        localspinNode.rotation = Quaternion(180.0, Vector3(0.0, 1.0, 0.0));
+
+        local modelObject = localspinNode:CreateComponent("AnimatedModel")
+        modelObject.model = cache:GetResource("Model", "Models/Kachujin/Kachujin.mdl")
+        modelObject.material = cache:GetResource("Material", "Models/Kachujin/Materials/Kachujin.xml")
         modelObject.castShadows = true
 
         -- Create an AnimationState for a walk animation. Its time position will need to be manually updated to advance the
         -- animation, The alternative would be to use an AnimationController component which updates the animation automatically,
         -- but we need to update the model's position manually in any case
-        local walkAnimation = cache:GetResource("Animation", "Models/Jack_Walk.ani")
+        local walkAnimation = cache:GetResource("Animation", "Models/Kachujin/Kachujin_Run.ani")
         local state = modelObject:AddAnimationState(walkAnimation)
         -- Enable full blending weight and looping
         state.weight = 1.0
@@ -216,7 +220,7 @@ function Mover:Update(timeStep)
     end
 
     -- Get the model's first (only) animation state and advance its time
-    local model = node:GetComponent("AnimatedModel")
+    local model = node:GetComponent("AnimatedModel", true)
     local state = model:GetAnimationState(0)
     if state ~= nil then
         state:AddTime(timeStep)

BIN
bin/Data/Models/Kachujin/Kachujin.mdl


BIN
bin/Data/Models/Kachujin/Kachujin_Run.ani


BIN
bin/Data/Models/Kachujin/Kachujin_Walk.ani


+ 36 - 0
bin/Data/Models/Kachujin/License.txt

@@ -0,0 +1,36 @@
+--------------------------
+note:
+--------------------------
+There is no requirement in the Mixamo License to provide any license information with any content.  
+However, for the purpose of learning, I have provided some pertinent information below.
+
+--------------------------
+info:
+--------------------------
+website: https://www.mixamo.com/
+model: Kachujin_G_Rosales
+license: http://www.adobe.com/legal/terms.html
+
+--------------------------
+license short explanation (from the forum):
+--------------------------
+Jeanette Mathews
+May 31, 2016 07:24
+
+Thanks for the feedback, and glad to hear the tutorial was useful getting you started.  :)
+
+Yes, all Fuse and Mixamo content is available for commercial and non commercial use, royalty free.  
+You can edit them to your hearts content!
+
+The only requirement we have is that the final product you are creating must have our content in an 'embedded', non-editable format.  
+So you can't edit the characters and sell them directly, because then other people have access to the character 3d data files.  
+Games, movies, 3d prints, 2D illustrations, or any other file format where the character/animation files are not-editable is fine.  
+Selling characters/animations directly is against the TOS/EULA.
+
+Hope that helps clarify!
+
+reference: https://community.mixamo.com/hc/en-us/community/posts/211496987-Mixamo-Store-Characters-Licence
+
+--------------------------
+
+

+ 10 - 0
bin/Data/Models/Kachujin/Materials/Kachujin.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<material>
+	<technique name="Techniques/DiffNormalSpec.xml" />
+	<texture unit="diffuse" name="Models/Kachujin/Textures/Kachujin_diffuse.png" />
+	<texture unit="normal" name="Models/Kachujin/Textures/Kachujin_normal.png" />
+	<texture unit="specular" name="Models/Kachujin/Textures/Kachujin_specular.png" />
+	<parameter name="MatDiffColor" value="0.8 0.8 0.8 1" />
+	<parameter name="MatSpecColor" value="0.5 0.5 0.5 20" />
+	<parameter name="MatEmissiveColor" value="0 0 0 1" />
+</material>

BIN
bin/Data/Models/Kachujin/Textures/Kachujin_diffuse.png


BIN
bin/Data/Models/Kachujin/Textures/Kachujin_normal.png


BIN
bin/Data/Models/Kachujin/Textures/Kachujin_specular.png


+ 12 - 7
bin/Data/Scripts/06_SkeletalAnimation.as

@@ -66,24 +66,28 @@ void CreateScene()
 
     // Create animated models
     const uint NUM_MODELS = 100;
-    const float MODEL_MOVE_SPEED = 2.0f;
+    const float MODEL_MOVE_SPEED = 4.0f;
     const float MODEL_ROTATE_SPEED = 100.0f;
     const BoundingBox bounds(Vector3(-47.0f, 0.0f, -47.0f), Vector3(47.0f, 0.0f, 47.0f));
 
     for (uint i = 0; i < NUM_MODELS; ++i)
     {
-        Node@ modelNode = scene_.CreateChild("Jack");
+        Node@ modelNode = scene_.CreateChild("Jill");
         modelNode.position = Vector3(Random(90.0f) - 45.0f, 0.0f, Random(90.0f) - 45.0f);
         modelNode.rotation = Quaternion(0.0f, Random(360.0f), 0.0f);
-        AnimatedModel@ modelObject = modelNode.CreateComponent("AnimatedModel");
-        modelObject.model = cache.GetResource("Model", "Models/Jack.mdl");
-        modelObject.material = cache.GetResource("Material", "Materials/Jack.xml");
+
+        Node@ spinNode = modelNode.CreateChild();
+        spinNode.rotation = Quaternion(180.0f, Vector3(0.0f, 1.0f, 0.0f));
+
+        AnimatedModel@ modelObject = spinNode.CreateComponent("AnimatedModel");
+        modelObject.model = cache.GetResource("Model", "Models/Kachujin/Kachujin.mdl");
+        modelObject.material = cache.GetResource("Material", "Models/Kachujin/Materials/Kachujin.xml");
         modelObject.castShadows = true;
 
         // Create an AnimationState for a walk animation. Its time position will need to be manually updated to advance the
         // animation, The alternative would be to use an AnimationController component which updates the animation automatically,
         // but we need to update the model's position manually in any case
-        Animation@ walkAnimation = cache.GetResource("Animation", "Models/Jack_Walk.ani");
+        Animation@ walkAnimation = cache.GetResource("Animation", "Models/Kachujin/Kachujin_Run.ani");
         AnimationState@ state = modelObject.AddAnimationState(walkAnimation);
         // Enable full blending weight and looping
         state.weight = 1.0f;
@@ -218,7 +222,7 @@ class Mover : ScriptObject
             node.Yaw(rotationSpeed * timeStep);
 
         // Get the model's first (only) animation state and advance its time
-        AnimatedModel@ model = node.GetComponent("AnimatedModel");
+        AnimatedModel@ model = node.GetComponent("AnimatedModel", true);
         AnimationState@ state = model.GetAnimationState(0);
         if (state !is null)
             state.AddTime(timeStep);
@@ -237,3 +241,4 @@ String patchInstructions =
     "        </element>"+
     "    </add>"+
     "</patch>";
+