(#1134) CrowdTriScript et expressions

8 views
Skip to first unread message

TeamTo

unread,
Sep 7, 2023, 4:17:38 AM9/7/23
to crowd...@golaem.com, olivier...@teamto.com
Submitted on Thursday, September 7, 2023 - 10:14
Submitted by anonymous user: 83.142.145.38
Submitted values are:

First Name: Olivier
Last Name: Monteil
Company: TeamTo
Status: Customer
Email: olivier...@teamto.com
Emails to CC:
Golaem Version: 8.2.1
Maya Version: 2022
Python Version: Python 3
OS: Windows
Distribution:
Renderer:
Other DCC:
Subject: CrowdTriScript et expressions
Attachment:
Details:
Bonjour,

J'essaie de trigger un node de CrowdBeEmit en fonction de l'animation de mon
entité, et pour éviter d'avoir 15 nodes d'expressions reliés par un
opérateur Or, je voulais utiliser un node de Script avec un array pour faire
ça, mais je n'arrive pas à faire fonctionner le système d'expressions dans
mon script MEL :


proc int isShooting(int $time){
int $frames[] = {10, 17, 21, 45, 49, 54, 59, 86, 115, 119, 226, 231,
236};
for ($f in $frames){
float $delta = $time -$f;
if (abs($delta) <= 0.5){
return true;
}
}
return false;
}
isShooting("##this.beMotionShape1.motionFrame##");


L'expression me renvoie 0 en permanence, je ne comprends pas où je me
trompe, merci d'avance!
Bonne journée,

Olivier


The results of this submission may be viewed at:
https://golaem.com/node/250/submission/8066

Nicolas Chaverou

unread,
Sep 7, 2023, 5:11:03 AM9/7/23
to crowd...@golaem.com, olivier...@teamto.com
Hey there,

When using the public support list, please write your messages in english so the community can also answer / learn from your thread
Else you can use the private list :)

See inlined below:

You probably find that ##channel## syntax on the Golaem Expressions documentation page here
This only gets evaluated when using Golaem Expressions but I'm afraid the Golaem Script Trigger is not part of this

You can evaluate your function the desired way in the Expression Trigger instead:

2023-09-07 10_53_11-untitled_ - Autodesk Maya 2020.4 - Not for Resale_ untitled   ---   triExpr1.png

You'll have to source your function before running your simulation.
Probably using a Maya script node

This having been said, evaluating MEL function at every frame for every character is really not recommended as it'll slow down drastically your simulation
I'll still recommend splitting your function in separated Expression Nodes - even if this is cumbersome
In upcoming versions you'll be able to set an array of values in the Expression Trigger and other triggers requiring numerical values

Hope that helps
Best,

Olivier MONTEIL

unread,
Sep 7, 2023, 6:02:35 AM9/7/23
to Nicolas Chaverou, crowd...@golaem.com
Hi,

Thanks for the quick reply I will stick to the Or operator then.

Have a nice day,

Olivier

De : Nicolas Chaverou <nicolas....@golaem.com>
Envoyé : jeudi 7 septembre 2023 11:10
À : crowd...@golaem.com <crowd...@golaem.com>
Cc : Olivier MONTEIL <olivier...@teamto.com>
Objet : Re: [Golaem Crowd] (#1134) CrowdTriScript et expressions
 
Reply all
Reply to author
Forward
0 new messages