1 /** 2 Animation Player that uses a node graph for blending Animations. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.animationtreeplayer; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.node; 24 import godot.animation; 25 /** 26 Animation Player that uses a node graph for blending Animations. 27 28 A node graph tool for blending multiple animations bound to an $(D AnimationPlayer). Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose. 29 It takes $(D Animation)s from an $(D AnimationPlayer) node and mixes them depending on the graph. 30 */ 31 @GodotBaseClass struct AnimationTreePlayer 32 { 33 enum string _GODOT_internal_name = "AnimationTreePlayer"; 34 public: 35 @nogc nothrow: 36 union { godot_object _godot_object; Node _GODOT_base; } 37 alias _GODOT_base this; 38 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 39 package(godot) __gshared bool _classBindingInitialized = false; 40 package(godot) static struct _classBinding 41 { 42 __gshared: 43 @GodotName("add_node") GodotMethod!(void, long, String) addNode; 44 @GodotName("node_exists") GodotMethod!(bool, String) nodeExists; 45 @GodotName("node_rename") GodotMethod!(GodotError, String, String) nodeRename; 46 @GodotName("node_get_type") GodotMethod!(AnimationTreePlayer.NodeType, String) nodeGetType; 47 @GodotName("node_get_input_count") GodotMethod!(long, String) nodeGetInputCount; 48 @GodotName("node_get_input_source") GodotMethod!(String, String, long) nodeGetInputSource; 49 @GodotName("animation_node_set_animation") GodotMethod!(void, String, Animation) animationNodeSetAnimation; 50 @GodotName("animation_node_get_animation") GodotMethod!(Animation, String) animationNodeGetAnimation; 51 @GodotName("animation_node_set_master_animation") GodotMethod!(void, String, String) animationNodeSetMasterAnimation; 52 @GodotName("animation_node_get_master_animation") GodotMethod!(String, String) animationNodeGetMasterAnimation; 53 @GodotName("animation_node_get_position") GodotMethod!(double, String) animationNodeGetPosition; 54 @GodotName("animation_node_set_filter_path") GodotMethod!(void, String, NodePath, bool) animationNodeSetFilterPath; 55 @GodotName("oneshot_node_set_fadein_time") GodotMethod!(void, String, double) oneshotNodeSetFadeinTime; 56 @GodotName("oneshot_node_get_fadein_time") GodotMethod!(double, String) oneshotNodeGetFadeinTime; 57 @GodotName("oneshot_node_set_fadeout_time") GodotMethod!(void, String, double) oneshotNodeSetFadeoutTime; 58 @GodotName("oneshot_node_get_fadeout_time") GodotMethod!(double, String) oneshotNodeGetFadeoutTime; 59 @GodotName("oneshot_node_set_autorestart") GodotMethod!(void, String, bool) oneshotNodeSetAutorestart; 60 @GodotName("oneshot_node_set_autorestart_delay") GodotMethod!(void, String, double) oneshotNodeSetAutorestartDelay; 61 @GodotName("oneshot_node_set_autorestart_random_delay") GodotMethod!(void, String, double) oneshotNodeSetAutorestartRandomDelay; 62 @GodotName("oneshot_node_has_autorestart") GodotMethod!(bool, String) oneshotNodeHasAutorestart; 63 @GodotName("oneshot_node_get_autorestart_delay") GodotMethod!(double, String) oneshotNodeGetAutorestartDelay; 64 @GodotName("oneshot_node_get_autorestart_random_delay") GodotMethod!(double, String) oneshotNodeGetAutorestartRandomDelay; 65 @GodotName("oneshot_node_start") GodotMethod!(void, String) oneshotNodeStart; 66 @GodotName("oneshot_node_stop") GodotMethod!(void, String) oneshotNodeStop; 67 @GodotName("oneshot_node_is_active") GodotMethod!(bool, String) oneshotNodeIsActive; 68 @GodotName("oneshot_node_set_filter_path") GodotMethod!(void, String, NodePath, bool) oneshotNodeSetFilterPath; 69 @GodotName("mix_node_set_amount") GodotMethod!(void, String, double) mixNodeSetAmount; 70 @GodotName("mix_node_get_amount") GodotMethod!(double, String) mixNodeGetAmount; 71 @GodotName("blend2_node_set_amount") GodotMethod!(void, String, double) blend2NodeSetAmount; 72 @GodotName("blend2_node_get_amount") GodotMethod!(double, String) blend2NodeGetAmount; 73 @GodotName("blend2_node_set_filter_path") GodotMethod!(void, String, NodePath, bool) blend2NodeSetFilterPath; 74 @GodotName("blend3_node_set_amount") GodotMethod!(void, String, double) blend3NodeSetAmount; 75 @GodotName("blend3_node_get_amount") GodotMethod!(double, String) blend3NodeGetAmount; 76 @GodotName("blend4_node_set_amount") GodotMethod!(void, String, Vector2) blend4NodeSetAmount; 77 @GodotName("blend4_node_get_amount") GodotMethod!(Vector2, String) blend4NodeGetAmount; 78 @GodotName("timescale_node_set_scale") GodotMethod!(void, String, double) timescaleNodeSetScale; 79 @GodotName("timescale_node_get_scale") GodotMethod!(double, String) timescaleNodeGetScale; 80 @GodotName("timeseek_node_seek") GodotMethod!(void, String, double) timeseekNodeSeek; 81 @GodotName("transition_node_set_input_count") GodotMethod!(void, String, long) transitionNodeSetInputCount; 82 @GodotName("transition_node_get_input_count") GodotMethod!(long, String) transitionNodeGetInputCount; 83 @GodotName("transition_node_delete_input") GodotMethod!(void, String, long) transitionNodeDeleteInput; 84 @GodotName("transition_node_set_input_auto_advance") GodotMethod!(void, String, long, bool) transitionNodeSetInputAutoAdvance; 85 @GodotName("transition_node_has_input_auto_advance") GodotMethod!(bool, String, long) transitionNodeHasInputAutoAdvance; 86 @GodotName("transition_node_set_xfade_time") GodotMethod!(void, String, double) transitionNodeSetXfadeTime; 87 @GodotName("transition_node_get_xfade_time") GodotMethod!(double, String) transitionNodeGetXfadeTime; 88 @GodotName("transition_node_set_current") GodotMethod!(void, String, long) transitionNodeSetCurrent; 89 @GodotName("transition_node_get_current") GodotMethod!(long, String) transitionNodeGetCurrent; 90 @GodotName("node_set_position") GodotMethod!(void, String, Vector2) nodeSetPosition; 91 @GodotName("node_get_position") GodotMethod!(Vector2, String) nodeGetPosition; 92 @GodotName("remove_node") GodotMethod!(void, String) removeNode; 93 @GodotName("connect_nodes") GodotMethod!(GodotError, String, String, long) connectNodes; 94 @GodotName("are_nodes_connected") GodotMethod!(bool, String, String, long) areNodesConnected; 95 @GodotName("disconnect_nodes") GodotMethod!(void, String, long) disconnectNodes; 96 @GodotName("set_active") GodotMethod!(void, bool) setActive; 97 @GodotName("is_active") GodotMethod!(bool) isActive; 98 @GodotName("set_base_path") GodotMethod!(void, NodePath) setBasePath; 99 @GodotName("get_base_path") GodotMethod!(NodePath) getBasePath; 100 @GodotName("set_master_player") GodotMethod!(void, NodePath) setMasterPlayer; 101 @GodotName("get_master_player") GodotMethod!(NodePath) getMasterPlayer; 102 @GodotName("get_node_list") GodotMethod!(PoolStringArray) getNodeList; 103 @GodotName("set_animation_process_mode") GodotMethod!(void, long) setAnimationProcessMode; 104 @GodotName("get_animation_process_mode") GodotMethod!(AnimationTreePlayer.AnimationProcessMode) getAnimationProcessMode; 105 @GodotName("advance") GodotMethod!(void, double) advance; 106 @GodotName("reset") GodotMethod!(void) reset; 107 @GodotName("recompute_caches") GodotMethod!(void) recomputeCaches; 108 } 109 bool opEquals(in AnimationTreePlayer other) const { return _godot_object.ptr is other._godot_object.ptr; } 110 AnimationTreePlayer opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 111 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 112 mixin baseCasts; 113 static AnimationTreePlayer _new() 114 { 115 static godot_class_constructor constructor; 116 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AnimationTreePlayer"); 117 if(constructor is null) return typeof(this).init; 118 return cast(AnimationTreePlayer)(constructor()); 119 } 120 @disable new(size_t s); 121 /// 122 enum AnimationProcessMode : int 123 { 124 /** 125 Process animation during the physics process. This is especially useful when animating physics bodies. 126 */ 127 animationProcessPhysics = 0, 128 /** 129 Process animation during the idle process. 130 */ 131 animationProcessIdle = 1, 132 } 133 /// 134 enum NodeType : int 135 { 136 /** 137 Output node. 138 */ 139 nodeOutput = 0, 140 /** 141 Animation node. 142 */ 143 nodeAnimation = 1, 144 /** 145 OneShot node. 146 */ 147 nodeOneshot = 2, 148 /** 149 Mix node. 150 */ 151 nodeMix = 3, 152 /** 153 Blend2 node. 154 */ 155 nodeBlend2 = 4, 156 /** 157 Blend3 node. 158 */ 159 nodeBlend3 = 5, 160 /** 161 Blend4 node. 162 */ 163 nodeBlend4 = 6, 164 /** 165 TimeScale node. 166 */ 167 nodeTimescale = 7, 168 /** 169 TimeSeek node. 170 */ 171 nodeTimeseek = 8, 172 /** 173 Transition node. 174 */ 175 nodeTransition = 9, 176 } 177 /// 178 enum Constants : int 179 { 180 nodeOutput = 0, 181 animationProcessPhysics = 0, 182 nodeAnimation = 1, 183 animationProcessIdle = 1, 184 nodeOneshot = 2, 185 nodeMix = 3, 186 nodeBlend2 = 4, 187 nodeBlend3 = 5, 188 nodeBlend4 = 6, 189 nodeTimescale = 7, 190 nodeTimeseek = 8, 191 nodeTransition = 9, 192 } 193 /** 194 Adds a `type` node to the graph with name `id`. 195 */ 196 void addNode(StringArg1)(in long type, in StringArg1 id) 197 { 198 checkClassBinding!(typeof(this))(); 199 ptrcall!(void)(_classBinding.addNode, _godot_object, type, id); 200 } 201 /** 202 Check if a node exists (by name). 203 */ 204 bool nodeExists(StringArg0)(in StringArg0 node) const 205 { 206 checkClassBinding!(typeof(this))(); 207 return ptrcall!(bool)(_classBinding.nodeExists, _godot_object, node); 208 } 209 /** 210 Rename a node in the graph. 211 */ 212 GodotError nodeRename(StringArg0, StringArg1)(in StringArg0 node, in StringArg1 new_name) 213 { 214 checkClassBinding!(typeof(this))(); 215 return ptrcall!(GodotError)(_classBinding.nodeRename, _godot_object, node, new_name); 216 } 217 /** 218 Get the node type, will return from NODE_* enum. 219 */ 220 AnimationTreePlayer.NodeType nodeGetType(StringArg0)(in StringArg0 id) const 221 { 222 checkClassBinding!(typeof(this))(); 223 return ptrcall!(AnimationTreePlayer.NodeType)(_classBinding.nodeGetType, _godot_object, id); 224 } 225 /** 226 Return the input count for a given node. Different types of nodes have different amount of inputs. 227 */ 228 long nodeGetInputCount(StringArg0)(in StringArg0 id) const 229 { 230 checkClassBinding!(typeof(this))(); 231 return ptrcall!(long)(_classBinding.nodeGetInputCount, _godot_object, id); 232 } 233 /** 234 Return the input source for a given node input. 235 */ 236 String nodeGetInputSource(StringArg0)(in StringArg0 id, in long idx) const 237 { 238 checkClassBinding!(typeof(this))(); 239 return ptrcall!(String)(_classBinding.nodeGetInputSource, _godot_object, id, idx); 240 } 241 /** 242 Binds a new $(D Animation) from the $(D masterPlayer) to the `AnimationTreePlayer`'s animation node with name `id`. 243 */ 244 void animationNodeSetAnimation(StringArg0)(in StringArg0 id, Animation animation) 245 { 246 checkClassBinding!(typeof(this))(); 247 ptrcall!(void)(_classBinding.animationNodeSetAnimation, _godot_object, id, animation); 248 } 249 /** 250 Returns the $(D AnimationPlayer)'s $(D Animation) bound to the `AnimationTreePlayer`'s animation node with name `id`. 251 */ 252 Ref!Animation animationNodeGetAnimation(StringArg0)(in StringArg0 id) const 253 { 254 checkClassBinding!(typeof(this))(); 255 return ptrcall!(Animation)(_classBinding.animationNodeGetAnimation, _godot_object, id); 256 } 257 /** 258 Binds the $(D Animation) named `source` from $(D masterPlayer) to the animation node `id`. Recalculates caches. 259 */ 260 void animationNodeSetMasterAnimation(StringArg0, StringArg1)(in StringArg0 id, in StringArg1 source) 261 { 262 checkClassBinding!(typeof(this))(); 263 ptrcall!(void)(_classBinding.animationNodeSetMasterAnimation, _godot_object, id, source); 264 } 265 /** 266 Returns the name of the $(D masterPlayer)'s $(D Animation) bound to this animation node. 267 */ 268 String animationNodeGetMasterAnimation(StringArg0)(in StringArg0 id) const 269 { 270 checkClassBinding!(typeof(this))(); 271 return ptrcall!(String)(_classBinding.animationNodeGetMasterAnimation, _godot_object, id); 272 } 273 /** 274 275 */ 276 double animationNodeGetPosition(StringArg0)(in StringArg0 id) const 277 { 278 checkClassBinding!(typeof(this))(); 279 return ptrcall!(double)(_classBinding.animationNodeGetPosition, _godot_object, id); 280 } 281 /** 282 If `enable` is `true`, the animation node with ID `id` turns off the track modifying the property at `path`. The modified node's children continue to animate. 283 */ 284 void animationNodeSetFilterPath(StringArg0, NodePathArg1)(in StringArg0 id, in NodePathArg1 path, in bool enable) 285 { 286 checkClassBinding!(typeof(this))(); 287 ptrcall!(void)(_classBinding.animationNodeSetFilterPath, _godot_object, id, path, enable); 288 } 289 /** 290 Sets fade in time of a OneShot node given its name and value in seconds. 291 */ 292 void oneshotNodeSetFadeinTime(StringArg0)(in StringArg0 id, in double time_sec) 293 { 294 checkClassBinding!(typeof(this))(); 295 ptrcall!(void)(_classBinding.oneshotNodeSetFadeinTime, _godot_object, id, time_sec); 296 } 297 /** 298 Returns fade in time of a OneShot node given its name. 299 */ 300 double oneshotNodeGetFadeinTime(StringArg0)(in StringArg0 id) const 301 { 302 checkClassBinding!(typeof(this))(); 303 return ptrcall!(double)(_classBinding.oneshotNodeGetFadeinTime, _godot_object, id); 304 } 305 /** 306 Sets fade out time of a OneShot node given its name and value in seconds. 307 */ 308 void oneshotNodeSetFadeoutTime(StringArg0)(in StringArg0 id, in double time_sec) 309 { 310 checkClassBinding!(typeof(this))(); 311 ptrcall!(void)(_classBinding.oneshotNodeSetFadeoutTime, _godot_object, id, time_sec); 312 } 313 /** 314 Returns fade out time of a OneShot node given its name. 315 */ 316 double oneshotNodeGetFadeoutTime(StringArg0)(in StringArg0 id) const 317 { 318 checkClassBinding!(typeof(this))(); 319 return ptrcall!(double)(_classBinding.oneshotNodeGetFadeoutTime, _godot_object, id); 320 } 321 /** 322 Sets autorestart property of a OneShot node given its name and value. 323 */ 324 void oneshotNodeSetAutorestart(StringArg0)(in StringArg0 id, in bool enable) 325 { 326 checkClassBinding!(typeof(this))(); 327 ptrcall!(void)(_classBinding.oneshotNodeSetAutorestart, _godot_object, id, enable); 328 } 329 /** 330 Sets autorestart delay of a OneShot node given its name and value in seconds. 331 */ 332 void oneshotNodeSetAutorestartDelay(StringArg0)(in StringArg0 id, in double delay_sec) 333 { 334 checkClassBinding!(typeof(this))(); 335 ptrcall!(void)(_classBinding.oneshotNodeSetAutorestartDelay, _godot_object, id, delay_sec); 336 } 337 /** 338 Sets autorestart random delay of a OneShot node given its name and value in seconds. 339 */ 340 void oneshotNodeSetAutorestartRandomDelay(StringArg0)(in StringArg0 id, in double rand_sec) 341 { 342 checkClassBinding!(typeof(this))(); 343 ptrcall!(void)(_classBinding.oneshotNodeSetAutorestartRandomDelay, _godot_object, id, rand_sec); 344 } 345 /** 346 Returns whether a OneShot node will auto restart given its name. 347 */ 348 bool oneshotNodeHasAutorestart(StringArg0)(in StringArg0 id) const 349 { 350 checkClassBinding!(typeof(this))(); 351 return ptrcall!(bool)(_classBinding.oneshotNodeHasAutorestart, _godot_object, id); 352 } 353 /** 354 Returns autostart delay of a OneShot node given its name. 355 */ 356 double oneshotNodeGetAutorestartDelay(StringArg0)(in StringArg0 id) const 357 { 358 checkClassBinding!(typeof(this))(); 359 return ptrcall!(double)(_classBinding.oneshotNodeGetAutorestartDelay, _godot_object, id); 360 } 361 /** 362 Returns autostart random delay of a OneShot node given its name. 363 */ 364 double oneshotNodeGetAutorestartRandomDelay(StringArg0)(in StringArg0 id) const 365 { 366 checkClassBinding!(typeof(this))(); 367 return ptrcall!(double)(_classBinding.oneshotNodeGetAutorestartRandomDelay, _godot_object, id); 368 } 369 /** 370 Starts a OneShot node given its name. 371 */ 372 void oneshotNodeStart(StringArg0)(in StringArg0 id) 373 { 374 checkClassBinding!(typeof(this))(); 375 ptrcall!(void)(_classBinding.oneshotNodeStart, _godot_object, id); 376 } 377 /** 378 Stops the OneShot node with name `id`. 379 */ 380 void oneshotNodeStop(StringArg0)(in StringArg0 id) 381 { 382 checkClassBinding!(typeof(this))(); 383 ptrcall!(void)(_classBinding.oneshotNodeStop, _godot_object, id); 384 } 385 /** 386 Returns whether a OneShot node is active given its name. 387 */ 388 bool oneshotNodeIsActive(StringArg0)(in StringArg0 id) const 389 { 390 checkClassBinding!(typeof(this))(); 391 return ptrcall!(bool)(_classBinding.oneshotNodeIsActive, _godot_object, id); 392 } 393 /** 394 If `enable` is `true`, the oneshot node with ID `id` turns off the track modifying the property at `path`. The modified node's children continue to animate. 395 */ 396 void oneshotNodeSetFilterPath(StringArg0, NodePathArg1)(in StringArg0 id, in NodePathArg1 path, in bool enable) 397 { 398 checkClassBinding!(typeof(this))(); 399 ptrcall!(void)(_classBinding.oneshotNodeSetFilterPath, _godot_object, id, path, enable); 400 } 401 /** 402 Sets mix amount of a Mix node given its name and value. 403 A Mix node adds input b to input a by a the amount given by ratio. 404 */ 405 void mixNodeSetAmount(StringArg0)(in StringArg0 id, in double ratio) 406 { 407 checkClassBinding!(typeof(this))(); 408 ptrcall!(void)(_classBinding.mixNodeSetAmount, _godot_object, id, ratio); 409 } 410 /** 411 Returns mix amount of a Mix node given its name. 412 */ 413 double mixNodeGetAmount(StringArg0)(in StringArg0 id) const 414 { 415 checkClassBinding!(typeof(this))(); 416 return ptrcall!(double)(_classBinding.mixNodeGetAmount, _godot_object, id); 417 } 418 /** 419 Sets the blend amount of a Blend2 node given its name and value. 420 A Blend2 Node blends two animations with the amount between 0 and 1. 421 At 0, Output is input a. 422 Towards 1, the influence of a gets lessened, the influence of b gets raised. 423 At 1, Output is input b. 424 */ 425 void blend2NodeSetAmount(StringArg0)(in StringArg0 id, in double blend) 426 { 427 checkClassBinding!(typeof(this))(); 428 ptrcall!(void)(_classBinding.blend2NodeSetAmount, _godot_object, id, blend); 429 } 430 /** 431 Returns the blend amount of a Blend2 node given its name. 432 */ 433 double blend2NodeGetAmount(StringArg0)(in StringArg0 id) const 434 { 435 checkClassBinding!(typeof(this))(); 436 return ptrcall!(double)(_classBinding.blend2NodeGetAmount, _godot_object, id); 437 } 438 /** 439 If `enable` is `true`, the blend2 node with ID `id` turns off the track modifying the property at `path`. The modified node's children continue to animate. 440 */ 441 void blend2NodeSetFilterPath(StringArg0, NodePathArg1)(in StringArg0 id, in NodePathArg1 path, in bool enable) 442 { 443 checkClassBinding!(typeof(this))(); 444 ptrcall!(void)(_classBinding.blend2NodeSetFilterPath, _godot_object, id, path, enable); 445 } 446 /** 447 Sets the blend amount of a Blend3 node given its name and value. 448 A Blend3 Node blends three animations with the amount between -1 and 1. 449 At -1, Output is input b-. 450 From -1 to 0, the influence of b- gets lessened, the influence of a gets raised and the influence of b+ is 0. 451 At 0, Output is input a. 452 From 0 to 1, the influence of a gets lessened, the influence of b+ gets raised and the influence of b+ is 0. 453 At 1, Output is input b+. 454 */ 455 void blend3NodeSetAmount(StringArg0)(in StringArg0 id, in double blend) 456 { 457 checkClassBinding!(typeof(this))(); 458 ptrcall!(void)(_classBinding.blend3NodeSetAmount, _godot_object, id, blend); 459 } 460 /** 461 Returns the blend amount of a Blend3 node given its name. 462 */ 463 double blend3NodeGetAmount(StringArg0)(in StringArg0 id) const 464 { 465 checkClassBinding!(typeof(this))(); 466 return ptrcall!(double)(_classBinding.blend3NodeGetAmount, _godot_object, id); 467 } 468 /** 469 Sets the blend amount of a Blend4 node given its name and value. 470 A Blend4 Node blends two pairs of animations. 471 The two pairs are blended like blend2 and then added together. 472 */ 473 void blend4NodeSetAmount(StringArg0)(in StringArg0 id, in Vector2 blend) 474 { 475 checkClassBinding!(typeof(this))(); 476 ptrcall!(void)(_classBinding.blend4NodeSetAmount, _godot_object, id, blend); 477 } 478 /** 479 Returns the blend amount of a Blend4 node given its name. 480 */ 481 Vector2 blend4NodeGetAmount(StringArg0)(in StringArg0 id) const 482 { 483 checkClassBinding!(typeof(this))(); 484 return ptrcall!(Vector2)(_classBinding.blend4NodeGetAmount, _godot_object, id); 485 } 486 /** 487 Sets the time scale of the TimeScale node with name `id` to `scale`. 488 The timescale node is used to speed $(D Animation)s up if the scale is above 1 or slow them down if it is below 1. 489 If applied after a blend or mix, affects all input animations to that blend or mix. 490 */ 491 void timescaleNodeSetScale(StringArg0)(in StringArg0 id, in double scale) 492 { 493 checkClassBinding!(typeof(this))(); 494 ptrcall!(void)(_classBinding.timescaleNodeSetScale, _godot_object, id, scale); 495 } 496 /** 497 Returns time scale value of the TimeScale node with name `id`. 498 */ 499 double timescaleNodeGetScale(StringArg0)(in StringArg0 id) const 500 { 501 checkClassBinding!(typeof(this))(); 502 return ptrcall!(double)(_classBinding.timescaleNodeGetScale, _godot_object, id); 503 } 504 /** 505 Sets the time seek value of the TimeSeek node with name `id` to `seconds` 506 This functions as a seek in the $(D Animation) or the blend or mix of $(D Animation)s input in it. 507 */ 508 void timeseekNodeSeek(StringArg0)(in StringArg0 id, in double seconds) 509 { 510 checkClassBinding!(typeof(this))(); 511 ptrcall!(void)(_classBinding.timeseekNodeSeek, _godot_object, id, seconds); 512 } 513 /** 514 Resizes the number of inputs available for the transition node with name `id`. 515 */ 516 void transitionNodeSetInputCount(StringArg0)(in StringArg0 id, in long count) 517 { 518 checkClassBinding!(typeof(this))(); 519 ptrcall!(void)(_classBinding.transitionNodeSetInputCount, _godot_object, id, count); 520 } 521 /** 522 Returns the number of inputs for the transition node with name `id`. You can add inputs by rightclicking on the transition node. 523 */ 524 long transitionNodeGetInputCount(StringArg0)(in StringArg0 id) const 525 { 526 checkClassBinding!(typeof(this))(); 527 return ptrcall!(long)(_classBinding.transitionNodeGetInputCount, _godot_object, id); 528 } 529 /** 530 Deletes the input at `input_idx` for the transition node with name `id`. 531 */ 532 void transitionNodeDeleteInput(StringArg0)(in StringArg0 id, in long input_idx) 533 { 534 checkClassBinding!(typeof(this))(); 535 ptrcall!(void)(_classBinding.transitionNodeDeleteInput, _godot_object, id, input_idx); 536 } 537 /** 538 The transition node with name `id` advances to its next input automatically when the input at `input_idx` completes. 539 */ 540 void transitionNodeSetInputAutoAdvance(StringArg0)(in StringArg0 id, in long input_idx, in bool enable) 541 { 542 checkClassBinding!(typeof(this))(); 543 ptrcall!(void)(_classBinding.transitionNodeSetInputAutoAdvance, _godot_object, id, input_idx, enable); 544 } 545 /** 546 Returns `true` if the input at `input_idx` on transition node with name `id` is set to automatically advance to the next input upon completion. 547 */ 548 bool transitionNodeHasInputAutoAdvance(StringArg0)(in StringArg0 id, in long input_idx) const 549 { 550 checkClassBinding!(typeof(this))(); 551 return ptrcall!(bool)(_classBinding.transitionNodeHasInputAutoAdvance, _godot_object, id, input_idx); 552 } 553 /** 554 The transition node with name `id` sets its cross fade time to `time_sec`. 555 */ 556 void transitionNodeSetXfadeTime(StringArg0)(in StringArg0 id, in double time_sec) 557 { 558 checkClassBinding!(typeof(this))(); 559 ptrcall!(void)(_classBinding.transitionNodeSetXfadeTime, _godot_object, id, time_sec); 560 } 561 /** 562 Returns the cross fade time for the transition node with name `id`. 563 */ 564 double transitionNodeGetXfadeTime(StringArg0)(in StringArg0 id) const 565 { 566 checkClassBinding!(typeof(this))(); 567 return ptrcall!(double)(_classBinding.transitionNodeGetXfadeTime, _godot_object, id); 568 } 569 /** 570 The transition node with name `id` sets its current input at `input_idx`. 571 */ 572 void transitionNodeSetCurrent(StringArg0)(in StringArg0 id, in long input_idx) 573 { 574 checkClassBinding!(typeof(this))(); 575 ptrcall!(void)(_classBinding.transitionNodeSetCurrent, _godot_object, id, input_idx); 576 } 577 /** 578 Returns the index of the currently evaluated input for the transition node with name `id`. 579 */ 580 long transitionNodeGetCurrent(StringArg0)(in StringArg0 id) const 581 { 582 checkClassBinding!(typeof(this))(); 583 return ptrcall!(long)(_classBinding.transitionNodeGetCurrent, _godot_object, id); 584 } 585 /** 586 Sets position of a node in the graph given its name and position. 587 */ 588 void nodeSetPosition(StringArg0)(in StringArg0 id, in Vector2 screen_position) 589 { 590 checkClassBinding!(typeof(this))(); 591 ptrcall!(void)(_classBinding.nodeSetPosition, _godot_object, id, screen_position); 592 } 593 /** 594 Returns position of a node in the graph given its name. 595 */ 596 Vector2 nodeGetPosition(StringArg0)(in StringArg0 id) const 597 { 598 checkClassBinding!(typeof(this))(); 599 return ptrcall!(Vector2)(_classBinding.nodeGetPosition, _godot_object, id); 600 } 601 /** 602 Removes the animation node with name `id`. 603 */ 604 void removeNode(StringArg0)(in StringArg0 id) 605 { 606 checkClassBinding!(typeof(this))(); 607 ptrcall!(void)(_classBinding.removeNode, _godot_object, id); 608 } 609 /** 610 Connects node `id` to `dst_id` at the specified input slot. 611 */ 612 GodotError connectNodes(StringArg0, StringArg1)(in StringArg0 id, in StringArg1 dst_id, in long dst_input_idx) 613 { 614 checkClassBinding!(typeof(this))(); 615 return ptrcall!(GodotError)(_classBinding.connectNodes, _godot_object, id, dst_id, dst_input_idx); 616 } 617 /** 618 Returns whether node `id` and `dst_id` are connected at the specified slot. 619 */ 620 bool areNodesConnected(StringArg0, StringArg1)(in StringArg0 id, in StringArg1 dst_id, in long dst_input_idx) const 621 { 622 checkClassBinding!(typeof(this))(); 623 return ptrcall!(bool)(_classBinding.areNodesConnected, _godot_object, id, dst_id, dst_input_idx); 624 } 625 /** 626 Disconnects nodes connected to `id` at the specified input slot. 627 */ 628 void disconnectNodes(StringArg0)(in StringArg0 id, in long dst_input_idx) 629 { 630 checkClassBinding!(typeof(this))(); 631 ptrcall!(void)(_classBinding.disconnectNodes, _godot_object, id, dst_input_idx); 632 } 633 /** 634 635 */ 636 void setActive(in bool enabled) 637 { 638 checkClassBinding!(typeof(this))(); 639 ptrcall!(void)(_classBinding.setActive, _godot_object, enabled); 640 } 641 /** 642 643 */ 644 bool isActive() const 645 { 646 checkClassBinding!(typeof(this))(); 647 return ptrcall!(bool)(_classBinding.isActive, _godot_object); 648 } 649 /** 650 651 */ 652 void setBasePath(NodePathArg0)(in NodePathArg0 path) 653 { 654 checkClassBinding!(typeof(this))(); 655 ptrcall!(void)(_classBinding.setBasePath, _godot_object, path); 656 } 657 /** 658 659 */ 660 NodePath getBasePath() const 661 { 662 checkClassBinding!(typeof(this))(); 663 return ptrcall!(NodePath)(_classBinding.getBasePath, _godot_object); 664 } 665 /** 666 667 */ 668 void setMasterPlayer(NodePathArg0)(in NodePathArg0 nodepath) 669 { 670 checkClassBinding!(typeof(this))(); 671 ptrcall!(void)(_classBinding.setMasterPlayer, _godot_object, nodepath); 672 } 673 /** 674 675 */ 676 NodePath getMasterPlayer() const 677 { 678 checkClassBinding!(typeof(this))(); 679 return ptrcall!(NodePath)(_classBinding.getMasterPlayer, _godot_object); 680 } 681 /** 682 Returns a $(D PoolStringArray) containing the name of all nodes. 683 */ 684 PoolStringArray getNodeList() 685 { 686 checkClassBinding!(typeof(this))(); 687 return ptrcall!(PoolStringArray)(_classBinding.getNodeList, _godot_object); 688 } 689 /** 690 691 */ 692 void setAnimationProcessMode(in long mode) 693 { 694 checkClassBinding!(typeof(this))(); 695 ptrcall!(void)(_classBinding.setAnimationProcessMode, _godot_object, mode); 696 } 697 /** 698 699 */ 700 AnimationTreePlayer.AnimationProcessMode getAnimationProcessMode() const 701 { 702 checkClassBinding!(typeof(this))(); 703 return ptrcall!(AnimationTreePlayer.AnimationProcessMode)(_classBinding.getAnimationProcessMode, _godot_object); 704 } 705 /** 706 Shifts position in the animation timeline. Delta is the time in seconds to shift. 707 */ 708 void advance(in double delta) 709 { 710 checkClassBinding!(typeof(this))(); 711 ptrcall!(void)(_classBinding.advance, _godot_object, delta); 712 } 713 /** 714 Resets this `AnimationTreePlayer`. 715 */ 716 void reset() 717 { 718 checkClassBinding!(typeof(this))(); 719 ptrcall!(void)(_classBinding.reset, _godot_object); 720 } 721 /** 722 Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state. 723 */ 724 void recomputeCaches() 725 { 726 checkClassBinding!(typeof(this))(); 727 ptrcall!(void)(_classBinding.recomputeCaches, _godot_object); 728 } 729 /** 730 The thread in which to update animations. Default value: `ANIMATION_PROCESS_IDLE`. 731 */ 732 @property AnimationTreePlayer.AnimationProcessMode playbackProcessMode() 733 { 734 return getAnimationProcessMode(); 735 } 736 /// ditto 737 @property void playbackProcessMode(long v) 738 { 739 setAnimationProcessMode(v); 740 } 741 /** 742 The path to the $(D AnimationPlayer) from which this `AnimationTreePlayer` binds animations to animation nodes. 743 Once set, Animation nodes can be added to the AnimationTreePlayer. 744 */ 745 @property NodePath masterPlayer() 746 { 747 return getMasterPlayer(); 748 } 749 /// ditto 750 @property void masterPlayer(NodePath v) 751 { 752 setMasterPlayer(v); 753 } 754 /** 755 The node from which to relatively access other nodes. Default value: `".."`. 756 It accesses the Bones, so it should point to the same Node the AnimationPlayer would point its Root Node at. 757 */ 758 @property NodePath basePath() 759 { 760 return getBasePath(); 761 } 762 /// ditto 763 @property void basePath(NodePath v) 764 { 765 setBasePath(v); 766 } 767 /** 768 If `true` the `AnimationTreePlayer` is able to play animations. Default value: `false`. 769 */ 770 @property bool active() 771 { 772 return isActive(); 773 } 774 /// ditto 775 @property void active(bool v) 776 { 777 setActive(v); 778 } 779 }