Re: [script] Tip: Avoid long parameter name to remain sane

Date : Thu, 3 May 2007 16:52:58 -0400
To : XSI(at)Softimage.COM
From : "Bernard Lebel" <3dbernard(at)gmail.com>
Subject : Re: [script] Tip: Avoid long parameter name to remain sane
Actually, for those weight parameters in the mixer, it might be 127, not 63.






On 5/3/07, Bernard Lebel <3dbernard(at)gmail.com> wrote:
It's the second time this happens for the same reason in the last 6
months. I just went through hours of suffering.
So I want to share this information with the list in case someone
finds it useful.

A parameter ScriptName and/or FullName should never exceed 63
characters. Period. It is legal in certain cases, but you may run into
horrible torments.



CASE 1:
A custom property had parameters named that way: "<scene object
fullname>_<other informations>". This was meant for the script to
retrieve those objects after the ppg inspection.

The script would loop the property parameters, split the parameter
name with underscore, and would use the "<other informations>" part
for various purposes. "<other informations>" was in fact very
important, it was a key for a dictionary.

Printing the parameter scriptname once added to the  custom property
revealed they were being truncated! So when using <other informations>
as a dictionary key, it would raise a key error. I found out parameter
script names were being truncated to 63 characters.



CASE 2:
Sometimes, for some unknown reasons, the connection between shape
tracks and the actual shape key no longer works. Changing the shape
slider in the Mixer has no effect on the object. My solution to this
is to keep a library of such connections for each character, so they
can be restored on demand by the animator via a pipeline tool.

Everything appears to be working fine. All parameters are collected,
stored, then exported to eani file. Action is then imported and
applied onto character model.

However, in some cases, not all shapes connections would be restored.
After hours and hours of messing around, I noticed that in the mixer,
the broken connection clips had a longer name than the others. This
vaguely reminded me about case 1. So I made my script rename some of
the objects in the parameter path to make the overall fullname
shorter.

It worked perfectly.




Cheers Bernard

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.