Renaming the Material Plugin

Hello Guys, i’m creating a simple plugin for my use.
This plugin has 3 icon, each icon add a new word at the end of the material…
Example: Before i use it, my material is “Color 01”, but when i click at the first icon, my material’s name is renamed by “Color 01 test”.
Any icon add a different word.
1° - “test”
2° - “test new”
3° - “testing”

But after i choose the 2° icon, i can’t change material anymore, always keep “Color 01 test new”.

Problably it’s because i’ve two word with an empty space between them, but how can i correct it?

Without seeing the code, I don’t see much chance of finding the problem.


Renan3DEnscapeMaterialConverter.rb (10.9 KB)

i don’t know why it’s crashing after selecting an icon that applies 2 separate names