TSShape::addSequence - cannot add because it already exists
by Judy L Tyrer · in Torque 3D Professional · 08/16/2009 (7:38 pm) · 4 replies
function AmyDts::onLoad(%this)
{
%this.addSequence("ambient", "root", "0", "30");
%this.addSequence("ambient", "run", "40", "120");
%this.addSequence("ambient", "special", "130", "150");
%this.setSequenceCyclic("Run", "1");
}
singleton TSShapeConstructor(AmyDts)
{
canSaveDynamicFields = "1";
baseShape = "art/shapes/players/Amy/Amy.DAE";
upAxis = "DEFAULT";
unit = "-1";
};Amy is a collada export and the sequences were separated in the editor. It all works the way I want (well, with the exception of the animations but what can you expect from engineering art). The problem is that I get a gazillion spurious error messages saying that all the base animations couldn't load because they were already loaded.
So, presumably they were loaded with the default characters which I haven't removed from my project yet. However, since Amy is a singleton and I don't define any of the default animations, they shouldn't be getting loaded. Am I missing something or is this just another error message in the long pile of TBDs that haven't been addressed yet?
#2
But while I have your attention.... is there a plan to take all the animation code out of hard-coded badness and turn it into data driven goodliness or is that something I should plan on doing myself. I need to know so I can budget the time (and money) required. I know, I should read the roadmap and one day I will - it's on my list right next to War and Peace and Finnegan's Wake.
08/17/2009 (12:17 am)
Okay, more than three :-) And I found the problem. The code is being executed twice, first from init.cs and then from datablockExec.cs. Is that client/server? At any rate, the error of the animations already being preloaded was actually in the beta4 code, not the beta5 code. The beta 5 code is properly whining about not being able to find them, as it should since they don't exist. I just got confused which window was which (I'm spoiled at work with dual monitors and here at home there is just the one).But while I have your attention.... is there a plan to take all the animation code out of hard-coded badness and turn it into data driven goodliness or is that something I should plan on doing myself. I need to know so I can budget the time (and money) required. I know, I should read the roadmap and one day I will - it's on my list right next to War and Peace and Finnegan's Wake.
#3
Since beta3 there is no need to manually execute TSShapeConstructor scripts. They are automatically executed by the engine just prior to loading the DTS or DAE file. See Artist Section/TSShapeConstructor at the official docs.
So.....there is no problem now?
Not sure what you mean.
08/17/2009 (1:38 am)
Quote:And I found the problem. The code is being executed twice, first from init.cs and then from datablockExec.cs. Is that client/server?
Since beta3 there is no need to manually execute TSShapeConstructor scripts. They are automatically executed by the engine just prior to loading the DTS or DAE file. See Artist Section/TSShapeConstructor at the official docs.
Quote:I just got confused which window was which
So.....there is no problem now?
Quote:But while I have your attention.... is there a plan to take all the animation code out of hard-coded badness and turn it into data driven goodliness
Not sure what you mean.
#4
As for "hard coded animations", I'm referring to the enum in player.h which enumerates each animation by name and pickActionAnimation() which sets the animations based on a hard coded priority. I will probably write a system to replace this so that it can read from a file at start-up, set the animation table and animation priorities from the same file. This would replace the hard coded enum and pickActionAnimation() code in the source. But before I do that, I was wondering if there were already plans for it.
Judy
08/22/2009 (8:04 pm)
Thanks, I'll try commenting out the lines that execute the TSShapeConstructor scripts and see if that works. As for "hard coded animations", I'm referring to the enum in player.h which enumerates each animation by name and pickActionAnimation() which sets the animations based on a hard coded priority. I will probably write a system to replace this so that it can read from a file at start-up, set the animation table and animation priorities from the same file. This would replace the hard coded enum and pickActionAnimation() code in the source. But before I do that, I was wondering if there were already plans for it.
Judy
Associate Chris Robertson
You are quite right that the default animations should NOT be getting loaded into your amy.dae model.
Are you sure that it is this model that is generating the error messages? I know that the BoomBot.dts for example includes a number of animations already and will generate the TSShape::addSequence errors if you try to load all of the default DSQs into it. There should be less than a gazillion of them though. ;-)
Could you upload and/or post the relevant part of your console.log?