Elvas Tower: Problem with Turntable Animation - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Problem with Turntable Animation Rate Topic: -----

#1 User is offline   Gman347 

  • Foreman Of Engines
  • Group: Status: First Class
  • Posts: 934
  • Joined: 18-June 11
  • Gender:Male
  • Country:

Posted 09 September 2017 - 09:20 AM

I know that I am way out of my depth but hanging around here pushes one to try such things.

I have built a model of a turntable that I am trying to animate with no success.

Attached Image: Ridgway Turntable.jpg


The model was created in Blender and I have set up the hierarchy so that there are basically three components. The object I call "MAIN" which is the square pier upon which the table is supported, an object I call "Pit", which includes the base, the perimeter walls and the rail and ties for the table, and an object I call "Table", which is the part that should rotate. In Blender, when I grab the item I call Table, all of the components rotate together within the pit as desired. I exported the model to an MSTS shape file and added the following animation code:

animations ( 1
animation ( 3600 30
anim_nodes ( 1
anim_node Table (
controllers ( 1
tcb_rot ( 3
slerp_rot ( 0 0 0 0 1 )
slerp_rot ( 1800 0 0.9999822 0 5.95526E-03 )
slerp_rot ( 3600 0 0 0 1 )
)
)
)
)
)
)



When I open the model in shape viewer and animate it the entire model is rotating. I have read the previous posts about animating turntables and thought that I understood what needed to be done, but obviously I don't. I did search around for a detailed guide on animating models but so far have only found bits and pieces so I am simply "cold copying" that code into the file.
Certainly not my preferred way of doing such things. Can someone please help?



Paul http://www.elvastower.com/forums/public/style_emoticons/default/biggrin.gif

P.S. Does anyone know of a good, detailed guide on the code in shape files that deals with animation?


#2 User is offline   ebnertra000 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,234
  • Joined: 27-February 17
  • Gender:Male
  • Location:East-Central Minnesota
  • Simulator:OR/TSRE
  • Country:

Posted 09 September 2017 - 10:02 AM

What I did when I made the replacement for the 42m table was copy the animation section from the 27m turntable file in the OR docs folder (one of those .zips in the sample files section). I also made mine with only two parts: TRACKPIECE for everything that moved and BASIN for everything that didn't. This is because those are the part names that the 27m animations reference and thus I could just drop them into my .s file after I built the turntable and go. If you go this route, I would make some dummy animation so you know where to put the animation at the end of the file

#3 User is offline   jared2982 

  • Superintendant
  • Group: Status: First Class
  • Posts: 1,187
  • Joined: 01-January 10
  • Gender:Male
  • Location:Louisiana
  • Simulator:MSTS, TS2017, OR
  • Country:

Posted 09 September 2017 - 12:05 PM

Sounds like a hierarchy issue. I don't know how blender handles this but it would seem that either your table is set as the main object or the animation was applied to the whole model.

#4 User is offline   Sandy River Tom 

  • Senior Foreman of Engines
  • Group: Status: Senior Foreman, Engines
  • Posts: 1,797
  • Joined: 22-April 06
  • Gender:Male
  • Location:Mystic, Connecticut
  • Simulator:ORTS-V1.5.1
  • Country:

Posted 09 September 2017 - 12:19 PM

Jared - you may have the answer in heirarchy.
IIRC, any Objects that are "children" of MAIN, become part of MAIN in the .s file.
What I've done for years is make a second "main" that I name Mn2 and make a child of MAIN
Then all other objects are made children of Mn2 and they remain separate.

In the case of the Turntable, the hierarchy would be:

MAIN
...|--Mn2
........|--Pit
........|--Table

HTH . . .

#5 User is offline   Gman347 

  • Foreman Of Engines
  • Group: Status: First Class
  • Posts: 934
  • Joined: 18-June 11
  • Gender:Male
  • Country:

Posted 09 September 2017 - 02:11 PM

Quote

the animation was applied to the whole model


Jared,

That certainly seems to be what is happening.

Here is the hierarchy as it shows in Blender:


Attached Image: heirarchy.jpg


'MAIN' is the parent and 'Pit' and 'Table' are the children. In Blender if I rotate 'MAIN' both 'Pit' and 'Table' rotate with it. But if I rotate 'Pit' or 'Table' they each move alone and the other two elements remain static. So in the model the hierarchy is is working correctly. It seems that something is happening in the export.

It seems to make no difference whether I apply the animation to 'MAIN' or to 'Table'. In either case the entire model rotates.



Tom,

I tried your suggestion, it sounded like a good idea, but it made no difference. http://www.elvastower.com/forums/public/style_emoticons/default/sad.gif



P.S.

Tom,

I hope your presence on the site is an indicator that your wife is doing well. I will continue to keep her in my prayers.

#6 User is online   wellsburg 

  • Conductor
  • Group: Status: First Class
  • Posts: 329
  • Joined: 29-January 04
  • Gender:Male
  • Location:Lakewood, Ohio
  • Country:

Posted 09 September 2017 - 02:28 PM

Hi,

Maybe this is getting too complicated. I have many successful turntable installations
with all stationary parts non-grouped under Main. All movable parts in a group called Wheel1 and a child of Main.
This is compiled to the .s using 3DCrafter but should make no difference how one gets to the .s

I suspect that the problem is with the animation code. Here is what 3DC generates.

animations ( 1
animation ( 3599 30
anim_nodes ( 2
anim_node MAIN (
controllers ( 0
)
)
anim_node WHEEL1 (
controllers ( 2
tcb_rot ( 5
slerp_rot ( 0 0 0 0 1 )
slerp_rot ( 900 0 -0.7071068 0 0.7071067 )
slerp_rot ( 1800 0 1 0 -1.629207E-07 )
slerp_rot ( 2700 0 0.7071066 0 0.7071069 )
slerp_rot ( 3600 0 0 0 1 )
)

)
)
)
)
)
)

Note that there are two animation nodes. One with no actual animation MAIN and second actual animation WHEEL1 .

The first animation node is missing in Paul's code example. Trim the turntable back to a Main and Wheel1, compile
to an .s, then append the above code to the end of the .s .

Mike



View PostSandy River Tom, on 09 September 2017 - 12:19 PM, said:

Jared - you may have the answer in heirarchy.
IIRC, any Objects that are "children" of MAIN, become part of MAIN in the .s file.
What I've done for years is make a second "main" that I name Mn2 and make a child of MAIN
Then all other objects are made children of Mn2 and they remain separate.

In the case of the Turntable, the hierarchy would be:

MAIN
...|--Mn2
........|--Pit
........|--Table

HTH . . .


#7 User is offline   Gman347 

  • Foreman Of Engines
  • Group: Status: First Class
  • Posts: 934
  • Joined: 18-June 11
  • Gender:Male
  • Country:

Posted 09 September 2017 - 04:33 PM

OK Guys,

I got it to work... http://www.elvastower.com/forums/public/style_emoticons/default/yahoo.gif In shape viewer... http://www.elvastower.com/forums/public/style_emoticons/default/unsure.gif Testing it in-sim is yet to come.

I got Blender to generate animation code in the shape file by adding a bone to the model and using it to define the rotation. But there was an additional catch. When I added the bone its longitudinal axis was vertical. I thought OK I want to rotate about that axis. But the vertical axis of the model is Z and the longitudinal axis of the bone is Y. Since the axes didn't match, when I tried to rotate the table about the Z axis it wouldn't work. So I had to rotate the bone 90 degrees to get its Z axis vertical. Once the axes matched I could do the rotation and define the animation in the model and export it. Simple, Huh? http://www.elvastower.com/forums/public/style_emoticons/default/ko2.gif It still didn't rotate properly on initial export but I edited the code lines to match the OR sample and voila, rotating smooth as silk.


Thanks guys for your help. Now the next step, get it into the sim. http://www.elvastower.com/forums/public/style_emoticons/default/mellow.gif


What a nice relaxing hobby! http://www.elvastower.com/forums/public/style_emoticons/default/tongue.gif


#8 User is offline   ErickC 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,001
  • Joined: 18-July 17
  • Gender:Male
  • Location:Hastings, MN, US
  • Simulator:ORTS
  • Country:

Posted 10 September 2017 - 11:13 AM

The .s format recognizes bones? I'll have to remember that...

#9 User is offline   Gman347 

  • Foreman Of Engines
  • Group: Status: First Class
  • Posts: 934
  • Joined: 18-June 11
  • Gender:Male
  • Country:

Posted 10 September 2017 - 04:03 PM

I wish I could tell you more about how this worked but at this point in time my knowledge is way too limited. http://www.elvastower.com/forums/public/style_emoticons/default/wtf01.gif All I know is that when I created the model with no animation I could not successfully add the animation to the exported .s file. By adding the bone and animating the table in the model the exported .s file included animation code which I was able to modify to make the table rotate as intended for OR. I suppose this is no different from any model that requires animation. Bones would be required in the model to achieve proper animation so while the .s file may not specifically recognize bones, as such, they are needed for the .s file to be properly formatted.

#10 User is offline   Jovet 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 2,250
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 12 September 2017 - 10:16 PM

It doesn't matter so much what the hierarchy looks like in Blender. It matters what it looks like in something like Shape Viewer.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users