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

Node_Animation Model Group #426

Merged
merged 18 commits into from
Jun 7, 2018
Merged

Node_Animation Model Group #426

merged 18 commits into from
Jun 7, 2018

Conversation

stevk
Copy link
Contributor

@stevk stevk commented May 29, 2018

Implements the Node_Animation model group.

Changed some of the runtime animation objects from structs to classes because the structs were causing issues with how we've been passing references.

Addresses several parts of #414
Fixes #404, #428

TODO:

  • I'm not sure I've correctly implemented a model for animating a curve that doesn't start at 0.
  • A proper texture still needs to be created to show which part of the model is supposed to be facing which way.
  • The validator shows an error in the bufferView for "Animation Sampler Output" for all of the models that are doing rotations. I'm not sure of the exact cause. "Accessor element at index # is not of unit length: 2."
  • I'm sure we can pick better values for the animations that what is currently plugged in.
  • Maybe we should add a notes column to describe the expected animation for each model?

@stevk stevk self-assigned this May 29, 2018
@stevk stevk requested review from kcoley and bghgary May 29, 2018 23:00
Model CreateModel(Action<List<Property>, List<Runtime.Channel>, Runtime.Node> setProperties)
{
var properties = new List<Property>();
var cube = Gltf.CreateCube();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return primitive instead of gltf


namespace AssetGenerator
{
internal class Node_Animation : ModelGroup
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node_Animation -> Animation_Node


The following table shows the properties that are set for a given model.

| | Sample Image | Translation | Rotation | Scale | Interpolation |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try a single column for Target(s) and list the targets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The (s) causes an error when used as a enum, so I went with Targets instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

{
public String Name { get; set; }
public List<AnimationChannel> AnimationChannels { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restore the Animation prefix for types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

channels.Add(new Runtime.Channel());
channels.Add(new Runtime.Channel());

SetTranslationChannelTarget(properties, channels[0], node);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a new properties list and then combine the strings afterwards into the real properties list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

new Vector2(1.000f, 0.000f),
new Vector2(0.500f, 0.000f),

// Right
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left <-> Right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

},
new List<Quaternion>
{
new Quaternion(0, 0, 0, 0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show Right, Front, then Left

properties.Add(new Property(PropertyName.Scale, ":white_check_mark:"));
}

void SetLinearSampler(List<Property> properties, Runtime.Channel channel)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a new function for Scale and rename this to be specific for Translation. Make scale half, normal, double

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor Author

@stevk stevk May 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made scale loop as well. Is it really nessessary to specify the 0,0,0 value? As far as I can tell, setting that middle value doesn't make a difference due to being exactly between the min/max values with equal time spacing between.

In reference to the linear sampler. It makes sense for the step sampler.

{
InTangent = new Vector3(1, 1, 1),
Value = new Vector3(0.1f, 0.1f, 0.1f),
OutTangent = new Vector3(1, 1, 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to zero.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

new Runtime.CubicSplineSampler<Vector3>.Key
{
InTangent = new Vector3(0, 0, 0),
Value = new Vector3(1, 1, 1),
Copy link
Collaborator

@bghgary bghgary May 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBD

@stevk
Copy link
Contributor Author

stevk commented May 30, 2018

Looking into #428 tomorrow for model 06. The model also appears to change scale when rotating, but I'm not sure if that is an issue or not.

properties.Add(new Property(PropertyName.Interpolation, "Cubic Spline"));
}

void SetLinearSamplerForRotation(List<Property> properties, Runtime.AnimationChannel channel)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this with the linear functions

@@ -0,0 +1,15 @@
These models are intended to test the basic attributes of animation on a node.

The last model on this list creates a curve which doesn't start at Zero.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -1,6 +1,6 @@
namespace AssetGenerator.Runtime
{
internal struct AnimationChannelTarget
internal class ChannelTarget
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the name and not the class to struct change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, switched that back around.

@@ -142,6 +142,8 @@ internal enum PropertyName
Translation,
Rotation,
Scale,
Targets,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to singular

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@stevk stevk merged commit c9c16e6 into KhronosGroup:master Jun 7, 2018
@stevk stevk deleted the nodeanimation branch June 7, 2018 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants