collada animation with multiple skeletons - animation

Ive been able to load static geometry using my own loader for collada that I wrote. However the next step is to add animation. The problem I am having is what do when an instance_controller has multiple skeletons. In my current model I am trying to load every node that is rigged is referencing every joint. For example
<instance_controller url="#geom-Cylinder018-skin1">
<skeleton>#node-Bone024</skeleton>
<skeleton>#node-Bone020</skeleton>
<skeleton>#node-Bone016</skeleton>
<skeleton>#node-Bone009</skeleton>
<skeleton>#node-Bone005</skeleton>
<skeleton>#node-Bone001</skeleton>
<skeleton>#node-Bone025</skeleton>
I am not sure what I am suppose to do with this? At the moment I am linking them all to the correct nodes in the visual_scene. However every node in the model does what you see above! Ive loaded it using AssimpView just to see that it actual is rendered and that works fine. Can anybody explain to me what I am suppose to do in the above situation. Thanks

In the COLLADA spec, it says that the <skeleton> underneath <instance_controller>:
Indicates where a skin controller is to start to search for the joint
nodes it needs
So, having multiple skeleton pointers inside the instance_controller just means that the nodes pointed to should all be searched for the correct joint nodes. The <controller> itself tells you which nodes should be used for the joints. It will have a source that looks something like this:
<library_controllers>
<controller id="skin">
<skin source="#base_mesh">
<source id="Joints">
<Name_array count="4"> Root Spine1 Spine2 Head </Name_array>
...
</source>
...
</controller>
</library_controllers>
The <node> that <skeleton> points to should be searched for a node with the sid of each joint name. For example, for the above controller, the node pointed to looks like this:
<node id="Skeleton1" sid="Root">
<node sid="Spine1">
<node sid="Spine2">
<node sid="Head"/>
</node>
</node>
</node>
Each joint name in the controller corresponds to the node with that sid value. If you have multiple skeleton tags, it just means you need to search more nodes for the given sid.

Related

camel:xpath. Selecting multiple values from a single node

I want to select a multiple values from an XML node.
ex:
<Root>
<SubRoot>
<Parent>Hiddic</Parent>
<Mother>Vim</Mother>
</SubRoot>
<SubRoot>
<Parent>Richie</Parent>
<Mother>Vile</Mother>
</SubRoot>
<SubRoot>
<Parent>Stroog</Parent>
<Mother>Murukku</Mother>
</SubRoot>
</Root>
From this example i want to extract the SubRoot nodes where is equals to Vim and Vile. I am using camel Xpath expression for this. And i am giving the inputs using a properties file.
This is the code i am using:
<setHeader headerName="newBody">
<xpath>//SubRoot[contains(Mother,"${properties:AlgoPosition.product.type.value}")]</xpath>
</setHeader>
The value in the property file is,
AlgoPosition,poduct.type.value = Vim,Vile;
If i give a single value in the property it retrieves me the correct node but when i give multiple values its failing. Please Help me in selecting multiple values.

MVCSitemapProvider current node not detected

I am using MvcSiteMapProvider 3.3.3.0 and have a file MvcSiteMap.sitemap which contains two nodes defined as follows:
<mvcSiteMapNode title="Node1" controller="MyController" action="MyAction" type="A" />
<mvcSiteMapNode title="Node2" controller="MyController" action="MyAction" type="B" />
My routes in global.asax.cs are configured "out of the box", so the URLs are:
Node 1: http://server/MyController/MyAction?type=A
Node 2: http://server/MyController/MyAction?type=B
Now if I navigate to Node 2, I find that MenuHelper.GetCurrentNode() returns Node 1.
Why is this and is there a way to get MvcSiteMapProvider to recognize a current node based on the querystring parameter?
I believe this is possible although I have not tested this. You should check out the wiki at their github repository. It has some usefull information but it still lacks some basic examples.
https://github.com/maartenba/MvcSiteMapProvider/wiki/Dynamic-sitemaps/
Unfortunately there is no way to do this.
I got around this problem using a custom DynamicNodeProvider, but it doesn't seem to fit in your case.

How to dynamically populate fields in node form from fields of a referenced node in Drupal 6

For a project, I have a Drupal 6 site with custom contents.
The first one is the content of type A, with textfields a1, a2, ...
The second one is the content of type B, with various fields b1, b2, ... and a arbitrary number of node references to A-type nodes. The node reference is done via an autocomplete widget. Each node ref is in a fieldgroup along with textfields b'1, b'2... I want the A-type nodes to act as templates to populate these fields, without having to submit the form.
To be more direct, I want, at the moment I select the ref to the A-type node, the fields b'1,... to be populated with the content of a1,... of the referenced node.
All the fields are single lines textfields.
I've read a lot of possible solutions but I'm little lost. From what I've seen, I should use AHAH and maybe make a module. I've tried a lot of modules but none is satisfying. I'm totally new in this part of Drupal (writing modules), and I would be pleased to have any advice or direction.
Thanks!
I do not know of a module that can do this for you "out of the box". If you want to learn about module development, a good place to start is the module developers guide:
http://drupal.org/node/206753
After you've gone through the tutorial, I'd look into how you create your own content type. This tutorial will teach you about the Form API, which is what you will eventually use to create the AHAH form you need.
http://drupal.org/node/231019
Good luck!

How to add an attribute to a node so it is the first one

I have a Nokogiri xml node:
node = <word n='ab' v='cd'>something</word>
I want to add an attribute:
node['p']='ef'
but in such a way that it 'shows' the first in the list of attributes, like
node = <word p='ef' n='ab' v='cd'>something</word>
Is there a simple way to do this?
I don't know of any XML serializer that allows you to control the order of attributes (except by accident, relying on undocumented features of a product). It shouldn't matter; the order is only cosmetic.
When you say "the order denotes the certitude" this is very worrying, because you are attaching meaning to the order of attributes when XML is very clear that the order will in general not be maintained. You need to redesign your XML to find a different way to capture this information.

Using Xpath to retrieve nodes satisfying a certain criteria, based on attribute values

<AgoraServersConfig>
<AgoraServers id="NYQ1">
<AgoraName>prod</AgoraName>
<TableName>someTable</TableName>
<Rule_ID>1</Rule_ID>
<Rule_ID>3</Rule_ID>
<Rule_ID>5</Rule_ID>
</AgoraServers>
<AgoraServers id ="QA03">
<AgoraName>dev</AgoraName>
<TableName>someTable</TableName>
<Rule_ID>1</Rule_ID>
<Rule_ID>2</Rule_ID>
<Rule_ID>5</Rule_ID>
</AgoraServers>
</AgoraServersConfig>
Given the above schema, I would like to know how to frame an Xpath query that returns the children of the node whose id is "QA03", for example.
Many Thanks in advance
Use:
/*/*[#id='QA03']/node()
It is also possible to use the standard XPath function id().
However, for this to work, there must be a DTD for the XML document that defines id as an "ID-type attribute".
Example: id('QA03')/node()
I'm not sure I fully understand your schema, but to return children of a node based on that node's id attribute would look something like
//*[#id='QA03']/*
The xpath would look like this:
/AgoraServersConfig/AgoraServers[#id='QA03']/*
If you wanted to do something a bit more dynamic, you could put the id into a variable, e.g.
<xsl:variable name="targetid">QA03</xsl:variable>
<xsl:for-each select="/AgoraServersConfig/AgoraServers[#id=$targetid]/*">
<xsl:copy-of select="."/>
</xsl:for-each>

Resources