doc Posted February 29, 2016 Share Posted February 29, 2016 I've always found quite annoying to name each single object while working in Blender.Expecially when it comes to make a model for Torque.If you are using trailing numbers for the LOD, you will quickly notice how splitting a mesh adds a .001,002 and such.Say we want to make a huge TSStatic and we want it to be culled in parts, the result will be similar:http://i.imgur.com/8d8OuLE.pngThere's a cool utility called Name Panel, and can be found here: https://github.com/trentinfrederick/name-panelYou just have to select your objects, the hit space, batch name and select "selected", the little brownish cube and done.No. Doesn't work with our LOD, it would number our shape as shapeLOD500.1 etc.How to solve this problem?download the zip from github and unpack it.go to scripts/function/batch.pyaround line 2576 https://github.com/trentinfrederick/name-panel/blob/master/scripts/function/batch.py#L2576change:[code2=python]# duplicates if collection[item[1]][0] not in duplicates: # name if hasattr(collection[item[1]][1][1], 'name'): collection[item[1]][1][1].name = collection[item[1]][0] + option.separator + '0'*option.padding + str(i + option.start).zfill(len(str(collection[item[1]][1][0]))) elif hasattr(collection[item[1]][1][1], 'info'):[/code2] to: [code2=python]# duplicates if collection[item[1]][0] not in duplicates: # name if hasattr(collection[item[1]][1][1], 'name'): optSt = option.start-1 if(optSt < 0): optSt = 0 trail = chr((i + optSt) + ord("A")); collection[item[1]][1][1].name = collection[item[1]][0] + option.separator + '0'*option.padding + trail + option.suffix elif hasattr(collection[item[1]][1][1], 'info'):[/code2] and around line 2595 https://github.com/trentinfrederick/name-panel/blob/master/scripts/function/batch.py#L2595change:[code2=python]# name if hasattr(item[1][1], 'name'): item[1][1].name = item[0] elif hasattr(item[1][1], 'info'):[/code2] to: [code2=python]# name if hasattr(item[1][1], 'name'): item[1][1].name = item[0] + option.suffix elif hasattr(item[1][1], 'info'):[/code2] at last, around line 2646 https://github.com/trentinfrederick/name-panel/blob/master/scripts/function/batch.py#L2646change: [code2=python]# prefix & suffix newName = option.prefix + newName + option.suffix[/code2] to: [code2=python]# prefix & suffix newName = option.prefix + newName[/code2] then install the script normally.When you will run the batch name, it will append the suffix at the end of the object's name and adds a letter instead of a number. For instance:CubeLOD300.1CubeLOD300.2CubeLOD300.3will be:Cube.ALOD300Cube.BLOD300Cube.CLOD300just remove the "separator" from the field in the menu to an empty and the suffix to -LOD300 and you will have:CubeA-LOD300CubeB-LOD300 and so on.the result with the previous example is now this:http://i.imgur.com/S4b51Ez.pngI hope it will be useful! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.