HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: does script have any control on bones?  (Read 2027 times)

feredfn

  • General Accounts
  • *
  • Posts: 154
    • View Profile
does script have any control on bones?
« on: Sep 06, 14, 01:18:37 PM »

I just wanted to know if we can translate, rotate or scale bones with hero scripts ? without a facegen model.
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: does script have any control on bones?
« Reply #1 on: Sep 06, 14, 01:29:45 PM »

I know for sure you can rotate them. This setup i use to rotate a propeller on a plane.

Code: [Select]
function RotateBone (knobValue references Float, knobName as String, tiltSpeed as Float, elapsed as TimeInterval, myChar as ID)
  knobValue = knobValue + elapsed.millisecondsTotal *  tiltSpeed
  if (knobValue >= 1) or (knobValue <= -1)
    knobValue = 0
  .
  SetAnimFloatKnob(myChar,knobName,knobValue)
.




And using an ASQ like this for example:

Code: [Select]
!
! Animation Sequence Spec
! template Sequence generated by Max or Maya output
Version=1
[ABILITIES]
 Apply Animation
    .Animation=AnimNone.hgm
    .InitialSpeed=1
    .InitialLoop=true
    .InitialAlign=false
    .VDA=false
  Rotate Bone
    .BoneName=bone verticalPropeller left 1
    .StartRotation=(360,0,0)
    .EndRotation=
    .LoopCount=0
    .Duration=0
    .ApplyToMotionVector=False
    .ScaleController=knobAnimVerticalPropellerLeft1
Logged

feredfn

  • General Accounts
  • *
  • Posts: 154
    • View Profile
Re: does script have any control on bones?
« Reply #2 on: Sep 07, 14, 12:41:06 AM »

Hm.. i see,.. looks a good method is this.. 
But the animnone.hgm  means it doesn't require an animation for the bone to rotate yes?
i mean,.. i don't want to animate the bone,.. then ask the script to play x frame of it.. i want the script can separately and entirely rotate the bone, regardless of other animations of the skeleton, which seems your method just does that.
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: does script have any control on bones?
« Reply #3 on: Sep 07, 14, 06:42:48 PM »

if you know the bone name you can manually rotate it, with script. I would have to look it up but do something like a search all script for rotate bone. Should find an example.

I'm 75% sure I ran across it when working on my custom fps camera.

Now the reason to use the fknob option is you can get better options with how and where and what direction the bone rotates in.

It's like providing the script an volume knob that says hey you can turn the volume up between 1 and 10 but no more. But the bass can go from 1 to 30. With good planning and technical artist direction you can build tools that allow the scripters to manage manual animation control while not creating bad mesh angles and morphing that causes the model to break in animations.
Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

feredfn

  • General Accounts
  • *
  • Posts: 154
    • View Profile
Re: does script have any control on bones?
« Reply #4 on: Sep 08, 14, 01:09:02 AM »

I see, thank you.. so the simplest answer to my first question is, Yes script can rotate a bone!
Thanks, i will soon check and if i made it , i will post it here :)
Logged