Board index FlightGear Development Aircraft

Animation of the objects  Topic is solved

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Animation of the objects

Postby V12 » Tue Sep 19, 2017 5:22 pm

I have problem with knob animation. I want use syntax :
Code: Select all
.
.
.
<axis>
    <object-name>some-object</object-name>
</axis>


but this doesn't work and my knob not rotate along designated axis. Where is problem ? Does works this FG 2017.2x feature ?
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: Animation of the objects

Postby Richard » Tue Sep 19, 2017 7:24 pm

It's a 2017.2 feature, as far as I can tell it works fine.

Paste the actual example together with a screenshot of the object you are using for the axis. The object that you use for the axis must have exactly two vertices.

see http://wiki.flightgear.org/Howto:Animate_models#Using_a_geometry_object_for_axis_and_centre_.282017.2.29
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: Animation of the objects  

Postby V12 » Tue Sep 19, 2017 8:26 pm

I did it, but didn't work. When renamed axis object in the animation, knob rotate as before axis rename :(
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: Animation of the objects

Postby Richard » Tue Sep 19, 2017 10:54 pm

just to be clear you have two objects.

I name this object and object-axis.

Like this. Image

and the animation is like this

Code: Select all
  <animation>
    <type>knob</type>
    <object-name>hud-vert-datum-knob</object-name>
    <property>controls/hud/vert-datum</property>
    <factor>20</factor>
    <axis>
      <object-name>hud-vert-datum-knob-axis</object-name>
    </axis>
    <action>
      <binding>
        <command>property-adjust</command>
        <property>controls/hud/vert-datum</property>
        <factor>1</factor>
        <min>0</min>
        <max>9</max>
        <wrap>false</wrap>
      </binding>
    </action>
  </animation>
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: Animation of the objects

Postby Necolatis » Tue Sep 19, 2017 11:36 pm

I guess if you export the object from Blender, you should check that it should export lines too, normally it only export faces (at least the exporter I work on, don't know what you use).
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Animation of the objects

Postby Richard » Wed Sep 20, 2017 12:16 am

that might be the problem. maybe try with a small triangle.
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: Animation of the objects

Postby V12 » Wed Sep 20, 2017 4:54 am

My Blender exported axis, I checked in the exported .AC file. There was object with correct name with 2 vertexes. I have stupid ask - how can I draw line in the Blender ??? I made plane, then deleted unnecessary edges and obtained line. I'm not sure with that solution...
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: Animation of the objects

Postby Necolatis » Wed Sep 20, 2017 5:04 am

For example Add-Curve-Path.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Animation of the objects

Postby litzi » Sun Sep 15, 2019 1:07 pm

Has this ever been resolved? I have encountered the same problem.

Image

I am trying to use an object-defined rotation axis with fg 2018.3.1 and I have in the XML:

Code: Select all
  <animation>
    <type>rotate</type>
    <object-name>main1</object-name>
    <property>/controls/switches/ecp/pos[0]</property>   
    <factor>-40</factor>
    <offset-deg>20</offset-deg>
    <axis>
      <object-name>axis1</object-name>   
    </axis>

  </animation>


in the AC3D file the object is existing and has two vertices.

Code: Select all
  OBJECT poly
  name "axis1"
  loc -2.6993561 0.1728181 0.0949574
  numvert 2
  0.0000000 0.0000000 0.0000000
  0.0000000 0.0000000 -0.2669734
  kids 0
 


The error message I am receiving is "Could not find a valid line segment for animation: axis1"

This would be indeed a very useful feature. Thanks in advance for your support!
litzi
 
Posts: 123
Joined: Sat May 03, 2014 9:59 pm
Location: AT
Version: 2018.3.1
OS: Ubuntu 14.04

Re: Animation of the objects

Postby Richard » Wed Sep 25, 2019 6:04 am

That looks like it should work; I'd need to see the entire .ac and .xml file to diagnose further.

You should also check for unique names; by convention axis1 should be called main1-axis
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: Animation of the objects

Postby vezza » Wed Jan 01, 2020 12:00 pm

same problem here... does someone has a solution for this problem?
vezza
 
Posts: 25
Joined: Sun Dec 16, 2012 12:02 am

Re: Animation of the objects

Postby WoodSTokk » Wed Jan 01, 2020 9:24 pm

I miss the connecting edge in the post from litzi.
A axis object should have 2 vertices connected with one edge.
If you export your model check 'Export lines'!
In the resulting ac file the axis object should have 'numvert 2' and additionally 'numsurf 1'.
WoodSTokk
 
Posts: 1077
Joined: Tue Oct 17, 2017 3:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: SX-W57
IRC name: WoodSTokk
Version: 2020.4.0
OS: Debian Bullseye


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 9 guests