Change name templating to &S and &N (less potential bugs).
It now also accepts lower case versions (&s and &n).
This commit is contained in:
@@ -2363,8 +2363,8 @@ static void view3d_panel_bonesketch_spaces(short cntrl)
|
||||
uiDefButF(block, NUM, B_DIFF, "D:", 143,yco, 67,19, &G.scene->toolsettings->skgen_retarget_distance_weight, 0, 10, 1, 0, "Distance Weight");
|
||||
yco -= 20;
|
||||
|
||||
uiDefBut(block, TEX,0,"S:", 10, yco, 90, 20, G.scene->toolsettings->skgen_side_string, 0.0, 8.0, 0, 0, "Text to replace %S with");
|
||||
uiDefBut(block, TEX,0,"N:", 100, yco, 90, 20, G.scene->toolsettings->skgen_num_string, 0.0, 8.0, 0, 0, "Text to replace %N with");
|
||||
uiDefBut(block, TEX,0,"S:", 10, yco, 90, 20, G.scene->toolsettings->skgen_side_string, 0.0, 8.0, 0, 0, "Text to replace &S with");
|
||||
uiDefBut(block, TEX,0,"N:", 100, yco, 90, 20, G.scene->toolsettings->skgen_num_string, 0.0, 8.0, 0, 0, "Text to replace &N with");
|
||||
uiDefIconButBitC(block, TOG, SK_RETARGET_AUTONAME, B_DIFF, ICON_AUTO,190,yco,20,20, &G.scene->toolsettings->skgen_retarget_options, 0, 0, 0, 0, "Use Auto Naming");
|
||||
|
||||
/* auto renaming magic */
|
||||
|
||||
@@ -460,14 +460,14 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo
|
||||
|
||||
for (i = 0, j = 0; template_name[i] != '\0' && i < 31 && j < 31; i++)
|
||||
{
|
||||
if (template_name[i] == '%')
|
||||
if (template_name[i] == '&')
|
||||
{
|
||||
if (template_name[i+1] == 'S')
|
||||
if (template_name[i+1] == 'S' || template_name[i+1] == 's')
|
||||
{
|
||||
j += sprintf(name + j, side_string);
|
||||
i++;
|
||||
}
|
||||
else if (template_name[i+1] == 'N')
|
||||
else if (template_name[i+1] == 'N' || template_name[i+1] == 'n')
|
||||
{
|
||||
j += sprintf(name + j, num_string);
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user