thanks diogo, very cool.
btw - support said:
"We don't have a list of illegal characters, however, please find below a
list
of valid characters.
Valid characters are
* letters (A-Z a-z, also including accented characters, letters in other
scripts)
* digits (0-9)
* the underscore (_)"
* no leading numbers at start of name
which we all knew but there it is in black and white
what I ended up doing
def annoyingBugEmail():
hey = setValue("Yo Silhouette fix your dumb software so it doesn't
write illegal node names ha ha lol lol :) :) :) :) ")
send[hey].body.mimetype42
postnumber = 14124 to silhouette forums
lovehate = relationship
annoyingBugEmail()
hey but on the plus side, expected 1 argument got 0
it's fixed on their side for the next version and I'll be able to remove my
bandaids
so I guess happy ending = true :)
(yes I'm totally bored btw)
On Mon, Jan 30, 2012 at 2:47 PM, Diogo Girondi <[email protected]>wrote:
> What I use here the following:
>
> def stringLegalize( text, joinchar=None, codif='utf-8' ):
>
> """
> stringLegalize( text, joinchar, codif ) -> str
>
> Replaces the illegal characters of a string for their respective
> alternatives.
> Special characters like bullets, etc are simply removed.
>
> @param text: String
> @oaram joinchar: String. Character to be used to replace spaces.
> Default is None
> @param codif: String. String representing the encoding type. Default
> value is 'utf-8'
> @return: String
> """
>
> from unicodedata import normalize
>
> legalstring = normalize( 'NFKD',
> text.decode(codif)).encode('ASCII','ignore' )
>
> if joinchar:
> return joinchar.join( legalstring.split() )
> else:
> return legalstring
>
>
> s = 'Braço do João 01'
> stringLegalize( s, '_' )
> >> 'Braco_do_Joao_01'
>
>
> Hope it helps.
>
> cheers,
> diogo
>
>
> On Mon, Jan 30, 2012 at 8:23 PM, J Bills <[email protected]> wrote:
>
>> thanks JRAB! I knew there had to be something out there.
>>
>> I have an email into support asking for clarification, will report back
>> if I get a definitive answer.
>>
>>
>> On Sat, Jan 28, 2012 at 4:11 PM, John RA Benson <[email protected]>wrote:
>>
>>> Hey J -
>>>
>>> I don't know if this is what Nuke uses, but it seems to work for us
>>> where there is potential for illegal chars:
>>>
>>> import re
>>>
>>> CHARFIX = re.compile("""[^\w]""")
>>>
>>> layerName = CHARFIX.sub('_', layerName)
>>>
>>> Cleans up the stuff that shouldn't be there for knobs and names. I've
>>> been able to create illegal names (like your roto exporter?), but then the
>>> names and knobs break or change to something legal when the script is
>>> reloaded. It would be nice if it wasn't allowed in the first place.
>>>
>>> JRAB
>>>
>>> On Jan 28, 2012, at 2:51 AM, J Bills wrote:
>>>
>>> howdy! thought someone here might have the answer to this
>>>
>>> I'm trying to find out exactly what sort of node name filtering
>>> heuristic that nuke runs oncreate
>>>
>>> We have a roto exporter that is somehow able to script illegal names in
>>> nuke and all appears well at first but once you start trying to parent
>>> expressions or whatnot, things quickly break. so I want to make sure our
>>> naming from the roto app is getting the same filtering as it comes across
>>> the Nuke.
>>>
>>> I couldn't find anything in the dev guide - anyone come across the info
>>> before?
>>>
>>> thanks!
>>> _______________________________________________
>>> Nuke-python mailing list
>>> [email protected], http://forums.thefoundry.co.uk/
>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>>
>>>
>>>
>>> _______________________________________________
>>> Nuke-python mailing list
>>> [email protected], http://forums.thefoundry.co.uk/
>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>>
>>>
>>
>> _______________________________________________
>> Nuke-python mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>
>>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python