Profile Picture

Script to automate breathing?

Posted By gordryd 5 Years Ago
You don't have permission to rate!
Author
Message
gordryd
gordryd
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)Distinguished Member (4.6K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 711, Visits: 7.6K
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.

Reallusion Certified Director / Reallusion Best Visual Award / Reallusion Certified Content Developer
See all the G-Tools Plug-Ins available for iClone here: G-Tools Plug-Ins


Kelleytoons
Kelleytoons
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 9.1K, Visits: 21.8K
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 R12, Win 10, i9-119000KF, 3.5GHz CPU, 128GB RAM, RTX 3090 (24GB), Samsung 960 Pro 4TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
The-any-Key
The-any-Key
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 356, Visits: 1.9K
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