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

(World Editor) Shape Editor() -> Properties -> Triggers : incorrect placement of onAddTrigger #1273

Closed
irei1as opened this issue Apr 14, 2015 · 1 comment
Labels
Milestone

Comments

@irei1as
Copy link
Contributor

irei1as commented Apr 14, 2015

(Error appears with Windows XP. Using precompiled binaries.)

Using the Shape Editor tool, animation triggers can't correctly be added to new sequences created from a longer sequence if the starting point ("in" value) isn't zero.

How to reproduce:
Create a project from the Full template.
Open the world editor and enter the Shape Editor() tab.
Open Library->art/shapes/weapons/Lurker/FP_Lurker (for example)
In "Properties", in the "Seq" tab, select "reload" (highlight it). That sequence was created from between the frames 460 and 550 of the source sequence called "timeline".
Now, for example, place the frame marker (of the VCR-like thing) at around the frame 500. That's correctly inside "reload" boundaries.
Try to add a new trigger (press the paper icon at the side of "Triggers").
You get the error: "Add trigger failed. Check the console for error messages."
The error message of the console says:"TSShape::addTrigger: Keyframe out of range (0-90 for sequence 'reload')".
But if the frame marker (of the VCR-like thing) is in the frame 10 -for example-, that's outside the boundaries of "reload" and it's the start of "timeline", and try to add the trigger again you get a correctly defined trigger for "reload" at frame 10.

The issue comes from ShapeEdSequences::onAddTrigger not taking in account the starting point of the sequence.

An example of how to fix it:
Change the "function ShapeEdSequences::onAddTrigger( %this ){...}" that you can see inside ShapeEditor.ed.cs from the line 2205 with:

function ShapeEdSequences::onAddTrigger( %this )
{
// Can only add triggers if a sequence is selected
%seqName = ShapeEdSequenceList.getSelectedName();
if ( %seqName !$= "" )
{
// Add a new trigger at the current frame
%frame = mRound( ShapeEdSeqSlider.getValue() ) - %this-->startFrame.getText();
if ((%frame < 0) || (%frame > %this-->endFrame.getText() - %this-->startFrame.getText()))
{
MessageBoxOK( "Error", "Trigger out of range of the selected animation." );
}
else
{
%state = ShapeEdTriggerList.rowCount() % 30;
ShapeEditor.doAddTrigger( %seqName, %frame, %state );
}
}
}

Note that in the repository there are two ShapeEditor.ed.cs (one for each default template):
https://github.com/GarageGames/Torque3D/blob/development/Templates/Empty/game/tools/shapeEditor/scripts/shapeEditor.ed.cs
https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/tools/shapeEditor/scripts/shapeEditor.ed.cs

@crabmusket
Copy link
Contributor

Thanks for the detailed report!

@crabmusket crabmusket added the Bug label Apr 16, 2015
@crabmusket crabmusket added this to the 3.8 milestone Apr 16, 2015
@Areloch Areloch modified the milestones: 3.9, 3.8 Oct 5, 2015
Azaezel added a commit to Azaezel/Torque3D that referenced this issue Jun 9, 2016
Areloch added a commit that referenced this issue Jun 18, 2016
@Areloch Areloch closed this as completed Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants