AddVisemeKey function is extremely slow with 7.3


https://forum.reallusion.com/Topic448523.aspx
Print Topic | Close Window

By butaixianran - 6 Years Ago
Function AddVisemeKey(self, kKey) is extremely slow with 7.73

I wrote a script to import some viseme motion data into iClone. It used to be fine. But with 7.73, it's very very slow.

To import a 2 minutes viseme motion, I have to wait about 20 minutes.

I debuged my script and find out function AddVisemeKey(self, kKey)  is the reason. 

I'm not sure it's a bug or it supposes to be slow from now on.

Here is my code, I know my code is right.
for loop
    do something

    if visemeId != RLPy.EVisemeID_NONE:
        viseme_key = RLPy.RVisemeKey()
        viseme_key.SetID(visemeId)
        viseme_key.SetWeight(weight)
        viseme_key.SetTime(convert_frameIndex_to_time(frame.frameIndex))
        viseme.AddVisemeKey(viseme_key)






By SeanMac - 6 Years Ago
May I suggest that You make a slight change to the subject name? Just from iClone 7.3 to 7.73?

The existing title could make readers think you should merely update.

Regards

SeanMac
By butaixianran - 6 Years Ago
SeanMac (6/23/2020)
May I suggest that You make a slight change to the subject name? Just from iClone 7.3 to 7.73?

The existing title could make readers think you should merely update.

Regards

SeanMac


I can't find a way to modify the title. Seems I can only edit the content but not title.
By AllenLee (RL) - 6 Years Ago
Hi butaixianran,

How many Viseme keys have you added?

In iClone version 7.73, we didn't make any changes to the Viseme API.

Allen Lee
By butaixianran - 6 Years Ago
AllenLee (RL) (6/24/2020)
Hi butaixianran,

How many Viseme keys have you added?

In iClone version 7.73, we didn't make any changes to the Viseme API.

Allen Lee


About 2000 key frames.

Well, last time I used this script was on 7.5, which works just fine.  You guys must have done something between 7.5 to 7.73.

You can just create 200 viseme key frames by script, you'll find out it's extremely slow. Then you can try to figure out what cause that.

By the way, before creating viseme key frames, I've already created a clip on viseme to fill the length.

Here is my code:
    viseme = main.avatar.GetVisemeComponent()
    # add clip
    viseme.AddVisemesClip(RLPy.RTime(0), "My_Viseme", convert_frameIndex_to_time(main.motionData.maxVisemeFrameIndex))


By AllenLee (RL) - 6 Years Ago
Hi  butaixianran,
Ok, I will check this function.

Allen Lee
By AllenLee (RL) - 6 Years Ago
Hi butaixianran,

I have found some ways to enhance the performance of this API, but it may be in iClone 7.9.
For now I suggest dividing the clip into multiple clips.
This will get you better performance.

Allen