Profile Picture

First Steps - Walk Down Stairs Script

Posted By videodv 5 Years Ago
Rated 4 stars based on 4 votes.
1
2
3
4

Author
Message
4u2ges
4u2ges
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 5.3K, Visits: 16.8K
I still hope you make this one day, videodv :)

Meantime I have made this tutorial a long time ago (someone might remember a couple of long threads about walking down).
It's about animating a basic loop manually with the help of Pose Manager plug-in. Pretty much labor intense and I was too lazy to comment it :Whistling:
But following it (given you have an even set of stairs converted to terrain), you may built your own walking down loop and multiply it.







animagic
animagic
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 15.8K, Visits: 31.4K
Thanks for your efforts anyway. Hopefully iClone 8 will make it easier or have it built in.

Motion clips are not really suitable because of the various dimensions of stairs.


https://forum.reallusion.com/uploads/images/436b0ffd-1242-44d6-a876-d631.jpg

videodv
videodv
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 342, Visits: 12.0K
Hi Animagic

While I did get the script to work with my own stairs mesh I could not get it ti work with other generic stairs as I kept getting a creeping error with the functions used to move the character that I could not resolve, Every now and then I have a fresh look at this but no luck yet, so its on the backburner for now.

Chris.
animagic
animagic
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)Distinguished Member (33.4K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 15.8K, Visits: 31.4K
I was looking for a walking up/down stairs animation and even though there is now one in ActorCore it is not adjustable and also there is only a female version...:unsure:

So I was wondering what happened to your script. It doesn't seem that it was ever published?


https://forum.reallusion.com/uploads/images/436b0ffd-1242-44d6-a876-d631.jpg

videodv
videodv
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 342, Visits: 12.0K
Lord Ashes (9/28/2020)
This is very impressive. I'm just starting out trying to make some Python scripts and I can't seem to find any script examples of simple bone manipulation (i.e. rotation). Your script obviously works with bones. Would you be able to post a small portion of your script (or a sample) of what needs to be done to manipulate a selected Avatar's bones? I posted this as a question in the forum but no one is answering.


Hi Lord Ashes

Here is a snippet that shoud get you going.

import math, RLPy

#-- Get Characters from current scene --#
avatar_list = RLPy.RScene.GetAvatars()
#-- Get First Character --#
avatar = avatar_list[0]

#-- Get Motion Bone Data --#
motion_bone = avatar.GetSkeletonComponent().GetMotionBones()
    
#-- Get First Clip --#
animation_clip = avatar.GetSkeletonComponent().GetClip(0)
#-- Extend the Clip length --#
#animation_clip.SetLength(RLPy.RTime(5000))

time = RLPy.RGlobal_GetTime()

#-- Find head bone --#
for bone in motion_bone:
    if bone.GetName() == "RL_Head":
        #-- Get Key from Layer --#
        head_control = animation_clip.GetControl("Layer", bone)
        data_block = head_control.GetDataBlock()
        float_control_rotate_x = data_block.GetControl("Rotation/RotationX")
        #-- Set Key in current time to rotate the head bone to 90 degree --#
        float_control_rotate_x.SetValue(time, math.radians(45))
        
    if bone.GetName() == "RL_L_Thigh":
        #-- Get Key from Layer --#
        head_control = animation_clip.GetControl("Layer", bone)
        data_block = head_control.GetDataBlock()
        float_control_rotate_x = data_block.GetControl("Rotation/RotationX")
        #-- Set Key in current time to rotate the head bone to 90 degree --#
        float_control_rotate_x.SetValue(time, math.radians(-45))
        
    if bone.GetName() == "RL_L_Calf":
        #-- Get Key from Layer --#
        head_control = animation_clip.GetControl("Layer", bone)
        data_block = head_control.GetDataBlock()
        float_control_rotate_x = data_block.GetControl("Rotation/RotationX")
        #-- Set Key in current time to rotate the head bone to 90 degree --#
        float_control_rotate_x.SetValue(time, math.radians(-40))
    # if bone.GetName() == "RL_L_Foot":
        # #-- Get Key from Layer --#
        # head_control = animation_clip.GetControl("Layer", bone)
        # data_block = head_control.GetDataBlock()
        # float_control_rotate_x = data_block.GetControl("Rotation/RotationX")
        # float_control_rotate_x = data_block.GetControl("Position/PositionX")
        # #-- Set Key in current time to rotate the head bone to 90 degree --#
        # float_control_rotate_x.SetValue(RLPy.RGlobal.GetTime(), math.radians(-15)) #RLPy.RVariant(35) math.radians(-45)

        
# avatar_list = RLPy.RScene.GetAvatars()
# avatar = avatar_list[0]

# Motion Bone: RL_L_Calf
# Motion Bone: RL_L_Toe
# Motion Bone: RL_Spine02
# Motion Bone: RL_L_Clavicle
# Motion Bone: RL_L_Thigh
# Motion Bone: RL_Waist
# Motion Bone: RL_Pelvis
# Motion Bone: RL_R_Toe
# Motion Bone: RL_Head
# Motion Bone: RL_Hips
# Motion Bone: RL_R_Thigh
# Motion Bone: RL_L_UpperArm
# Motion Bone: RL_L_Foot
# Motion Bone: RL_L_Finger42
# Motion Bone: RL_R_Clavicle
# Motion Bone: RL_R_UpperArm
# Motion Bone: RL_R_Forearm
# Motion Bone: RL_R_Hand
# Motion Bone: RL_R_Calf
# Motion Bone: RL_R_Foot
# Motion Bone: RL_Neck
# Motion Bone: RL_L_Forearm
# Motion Bone: RL_Spine01
# Motion Bone: RL_L_Hand

you can also follow this link here

Hope all goes well
Chris

Eric C (RL)
Eric C (RL)
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)Distinguished Member (11.8K reputation)

Group: Administrators
Last Active: 2 Months Ago
Posts: 552, Visits: 6.0K
Hi @Lord Ashes,

Thanks for reply and we are calling some help now.
We will get back to you soon!

Eric 
Lord Ashes
Lord Ashes
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)Distinguished Member (22.4K reputation)

Group: Forum Members
Last Active: Last Year
Posts: 1.3K, Visits: 1.6K
This is very impressive. I'm just starting out trying to make some Python scripts and I can't seem to find any script examples of simple bone manipulation (i.e. rotation). Your script obviously works with bones. Would you be able to post a small portion of your script (or a sample) of what needs to be done to manipulate a selected Avatar's bones? I posted this as a question in the forum but no one is answering.

"We often compare ourselves to the U.S. and often they come out the best, but they only have the right to bear arms while we have the right to bare breasts"
Bowser and Blue, Busting The Breast
videodv
videodv
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 342, Visits: 12.0K
Had a quick re_jiggle with the ui.

https://forum.reallusion.com/uploads/images/abe15f21-857d-4b82-96da-a707.jpg

Chris.
edited to correct spelling mistake on the ui :blush:
videodv
videodv
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)Distinguished Member (2.9K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 342, Visits: 12.0K
Rampa (5/5/2020)
That is a much smoother motion though! 
Try enabling foot contact, maybe?


HI Rampa
Nope foot contact has no effect.

Just wondering if when placing the keys they should be in either local or world co_ordinates?

Chris.

Rampa
Rampa
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)Distinguished Member (37.5K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 8.2K, Visits: 62.6K
That is a much smoother motion though! 
Try enabling foot contact, maybe?

1
2
3
4



Reading This Topic