Profile Picture

Script to automate breathing?

Posted By gordryd Last Month
You don't have permission to rate!
Author
Message
gordryd
gordryd
Posted Last Month
View Quick Profile
Distinguished Member

Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)Distinguished Member (1.3K reputation)

Group: Forum Members
Last Active: 6 hours ago
Posts: 190, Visits: 2.7K
Now that people have had some time to play around with Python, is it possible to create a script to make an avatar 'breathe'?  Basic functionality should include the ability to choose which character and adjust breathing rate/intensity;  add'l helpful feature would be frame range to apply.
Kelleytoons
Kelleytoons
Posted Last Month
View Quick Profile
Distinguished Member

Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)Distinguished Member (18.9K reputation)

Group: Forum Members
Last Active: 6 hours ago
Posts: 5.9K, Visits: 11.9K
Assuming you had a "breathe" morph (more below) the coding is pretty simple and straightforward (this should give you all you need to get started):

import RLPy
avatar_list = RLPy.RScene.GetSelectedObjects()
for object in selected_list: #for all selected
    if object == RLPy.EObjectType_Avatar: #if is avatar
    avatar = object #just for reading purposes
    morph_component = avatar.GetMorphComponent()
    morph_names = morph_component.GetMorphNames("your_mesh_name")
    result = morph_component.AddKey( "your_mesh_name", "your_morph_name", RLPy.RTime(67),  0.5, False, False )


The real problem is that morph -- can't program it automagically.  So you would need to somehow develop it and, further, apply it (AFAIK you can't add a morph programmatically.  I might be mistaken in this but it doesn't appear so from first glance, although I just woke up from a nap).  If so, then the avatar you wanted to run this on would both have to have such a morph already applied AND the name would need to be standardized for automagic applying it (or you could have the interface select it I guess -- I'm not really going to do any UI in Python just yet but I know there are a few here who have who could help you).



Alienware Aurora R7, Win 10, i7-8700k, 4.7GHz CPU, 32GB RAM, GTX Titan XP (12GB), Samsung 960 Pro 2TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
The-any-Key
The-any-Key
Posted Last Month
View Quick Profile
Distinguished Member

Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)Distinguished Member (1.4K reputation)

Group: Forum Members
Last Active: 10 minutes ago
Posts: 260, Visits: 1.3K
I saw this post and added a time feature in my Morph linker plugin so you can apply morphs with time.





iClone 7, 3DXchange 7 Pipeline, CC3 Pipeline, CT8 Pipeline, Iray, Live Face, iPhone Xr, Win 10, i9 9900K ~5GHz, Nvidia RTX 2080 8GB, 16GB Ram, M.2 SSD



Reading This Topic