Page 1 of 2 12 LastLast
Results 1 to 20 of 28
  1. #1

    import BrushSet (addon)

    ive created a addon a while back to import all textures from a folder at once, the main idea for me was that i dont have to load several textures manually that i want to use for texture painting or sculpting and to learn a bit about the new blender

    here is the script:
    (see attachment)
    http://projects.blender.org/tracker/...tail&aid=25702
    http://wiki.blender.org/index.php/Ex...xport/BrushSet

    (if anyone has a better place to upload this please let me know)

    and here is how its done:
    save the .py file to your scripts folder, start blender and activate the addon.

    after that you will find a new import option


    from there select the folder where your textures are located that you want to import


    depending on the amount of texture files this can take a moment:O

    now you can go into texture paint or sculpt mode and open the texture selection, all the textures should be available to use now.


    hope you like it, comments and crits are always welcome
    Attached Files Attached Files
    Last edited by kromar; 07-Nov-11 at 03:55. Reason: added links



  2. #2
    Awesome !! nice... its make easy !



  3. #3
    forget, could you share your texture library



  4. #4
    glad you like it, my texture library is a bit big to upload somewhere... but you can get free textures everywhere on the web, here is a good one: http://www.cgtextures.com



  5. #5
    Member tungee's Avatar
    Join Date
    Nov 2007
    Location
    Germany Frankfurt
    Posts
    1,421
    Thanx Kromar!



  6. #6
    Great work...

    Do you thing to add a possibility to select manually a set of textures and not all the folder?



  7. #7
    Originally Posted by bleber View Post
    Great work...

    Do you thing to add a possibility to select manually a set of textures and not all the folder?
    thats not a bad idea i dont know how to do that yet but i will try to find a way to do that



  8. #8
    ive updated the script to work with the latest blender builds, if you have any problems let me know
    io_import_BrushSet.py - 0.00MB



  9. #9
    Member Storrboy's Avatar
    Join Date
    Aug 2010
    Location
    York, Ont, Canada
    Posts
    394
    I have another suggestion if you or someone is inclined to work on this at some point, but I don't anything about python and couldn't y suggest a method of doing so. The ability to remove those imported brushes when they are no longer needed would be great. I recently accidentally imported a folder with a hundred or so images in it, and now have to remove them one by one to make the file small enough to distribute by email. Just a thought anyway.



  10. #10
    well that is a bit of a problem the way blender works at the moment. the only way to do that is to import the brushes without fake user and then restart blender to get rid of all the brushes. if you have all your brushes with a fake user flag then here is something for you to remove all the fake users:

    Code:
    for tex in bpy.data.images:
    	tex.use_fake_user = False
    	print(tex)
    	
    for tex in bpy.data.textures:
    	tex.use_fake_user = False
    	print(tex)
    	
    for tex in bpy.data.brushes:
    	tex.use_fake_user = False
    	print(tex)
    enter this in the console in blender and hit enter 2 times. then save youur scene (best as seperate blend ) and restart blender.

    NOTE: this will also remove texture/vertex paint and sculpt brushes. these can be imported again with shift+F1 from a other blend file.

    EDIT: not sure if you use my script or the option from the "Texture Paint Layer Manager". my script should import the textures without fake user and a simple restart of blender will remove all the imported textures again.



  11. #11
    Hi kromar, I've tried to make a script that import automatically brush or other sets automatically in blender on start up, but i'm new on python so i can't get the path by code. fortunately i'v discover you script so Thanks!

    however is not the same as i want so i make some change, so now it automatically load on start up the brush on a predefined folder specified on user preference.

    this is the code so if some one want it this is it (if you have any problem let me know):

    Code:
    # ***** BEGIN GPL LICENSE BLOCK *****
    #
    # This program is free software; you can redistribute it and/or
    # modify it under the terms of the GNU General Public License
    # as published by the Free Software Foundation; either version 2
    # of the License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software Foundation,
    # Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    #
    # ***** END GPL LICENCE BLOCK *****
    
    # ----------------------------------------------------------------------------#    
    
    '''
    todo:
    - add file selection for single and multiple files
    
    changelog:
        "version": (1,1,4),
            filename will be used as texture name (still limited by stringlength)
    
    
        "version": (1,1,3),
        fixed operator and registration
        added tracker and wiki url\
        
    version": (1,1,2)
        replaced image.new() with image.load()
        changed addon category
        removed some unused/old code    
        
    version":1.11:
        added type arg to texture.new() [L48]
        cleared default filename
    ''' 
    
    # ----------------------------------------------------------------------------#    
    
    import bpy
    import os
    from bpy.props import *
    
    #addon description
    bl_info = {
        "name": "Auto Load BrushSet",
        "author": "Daniel Grauer",
        "version": (1, 1, 5),
        "blender": (2, 6, 2),
        "category": "System",
        "location": "Automatically load on start up, User preference, File",
        "description": "Imports all image files from a folder",
        "warning": '', # used for warning icon and text in addons panel
        "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Import-Export/BrushSet",
        "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=25702&group_id=153&atid=467",
        }
    
    breakpoint = bpy.types.bp.bp
    
    #extension filter (alternative use mimetypes)
    ext_list = ['jpg',
                'bmp',
                'iris',
                'png',
                'jpeg',
                'targa',
                'tga'];
    
    def LoadBrushSet(filepath, filename):
         
        
        for file in os.listdir(filepath):
            path = (filepath + file)
            #get folder name
            (f1, f2) = os.path.split(filepath)
            (f3, filename) = os.path.split(f1)
            
            texturename = file         # file        "texture"    foldername
            
            #filter ext_list
            if file.split('.')[-1].lower() in ext_list: 
                #create new texture
                texture = bpy.data.textures.new(texturename, 'IMAGE')    #watch it, string limit 21 ?!
    
                #create new image
                image = bpy.data.images.load(path)
                image.source = "FILE"
                image.filepath = path
                bpy.data.textures[texture.name].image = image
           
           # for tex in bpy.data.textures:
           #     tex.name = filename   
                 
    #for tex in bpy.data.images:
    #	tex.use_fake_user = False
    #	print(tex)
    	
    #for tex in bpy.data.textures:
    #	tex.use_fake_user = False
    #	print(tex)
    	
    #for tex in bpy.data.brushes:
    #	tex.use_fake_user = False
    #	print(tex)
    
    # ----------------------------------------------------------------------------#    
    
    class BrushSetImporter(bpy.types.Operator):
        '''Load Brush Set'''
        bl_idname = "import_image.brushset"
        bl_label = "Import BrushSet"
    
        bpy.types.Scene.filename = StringProperty(name="File Name", description="filepath", default="", maxlen=1024, subtype='DIR_PATH')
        bpy.types.Scene.filepath = StringProperty(name="File Path", description="Brush location", default="", maxlen=1024, subtype='DIR_PATH')
        scn = bpy.context.scene
       
    #    if scn.filepath == "":  #first run
    #        os.mkdir("/temp")
    #       scn.filepath = "/temp"
    #    else:
    #        scn.filepath = bpy.context.scene.filepath 
        
          
        if scn.filepath == "":
            pass
        else:
            LoadBrushSet(scn.filepath, scn.filename)
           
    
    
    
    # ----------------------------------------------------------------------------#    
    #def menu_func(self, context):
    #    #clear the default name for import
    #    default_name = "" 
    #
    #    self.layout.operator(BrushSetImporter.bl_idname, text="Brush Set").filename = default_name
    # ----------------------------------------------------------------------------#    
    class Brush_set_UI(bpy.types.Panel):
    
        bl_space_type ='USER_PREFERENCES'
        bl_label = 'Brush_Path'
        bl_region_type = 'WINDOW'
        bl_options = {'HIDE_HEADER'}
       
       
    
        def draw(self, context):
            
            scn = context.scene 
            layout = self.layout
            column = layout.column(align=True)
            column.label(text='Brush Directory:')
            column.prop(scn,'filepath')  
            
    #if bpy.context.scene.filepath != "/temp":
    #    os.rmdir('/temp')		
    def register():    
        
        bpy.utils.register_class(Brush_set_UI)
        #bpy.types.INFO_MT_file_import.append(menu_func)
        bpy.utils.register_module(__name__)
        
    
    def unregister():
        bpy.utils.unregister_class(Brush_set_UI)
        bpy.utils.unregister_class(BrushSetImporter)
        #bpy.types.INFO_MT_file_import.remove(menu_func)
    
    if __name__ == "__main__":
        register()
    Last edited by rebellion; 03-Apr-12 at 04:00.



  12. #12
    oh sorry i did not see your post:O
    i dont know if its possible to load something on start but im rewriting some of the addon at the moment and will take a look at what youve done



  13. #13
    Member NIWO's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Posts
    25
    Hello,

    is there any update on this addon?
    It doesn't work on Blender 2.72.

    I am working with Win 8.1.

    NIWO
    Last edited by NIWO; 03-Nov-14 at 18:39.



  14. #14
    Yeah, me too I'd like to have this updated. It's a really usefull addon. Please update it!



  15. #15
    Member Craig Jones's Avatar
    Join Date
    Apr 2006
    Location
    Yoakum, TX
    Posts
    6,148
    I was looking for this addon, and the realized it isn't working at the moment. I gave it some thought, and realized that a similar functionality is available that works pretty well, already included in blender now.

    I used the same technique to make an Alchemy styled brush setup with multiple images. The trick is to create a folder of images that you what to use, and batch rename them to make them into an image sequence. If need be, and they are all the same size, you coudl use the VSE to load them and export them as frames to the folder.

    Loading them up all at the same time, blender sees them as a movie or image sequence, and is ready to use them as a texture. I had used the timeline before to 'play' the images through, cycling them through, but in this case you use the arrow key to find the one you want, looking at the texture properties panel preview to see what is current to frame.brush_masks_as_image_sequence_step_w_arrow.jpg



  16. #16
    Member Photox's Avatar
    Join Date
    Jan 2013
    Location
    South Florida
    Posts
    3,726
    I use this add on all the time, Thank you!
    GTX 780-i5 Quad-16 GB
    Chocobanana - The Captain - Snow Leopard- Neanderthal



  17. #17
    I didn't know this addon existed and also made an addon for this. https://github.com/amb/blender-scrip...load_alphas.py

    It adds an "Texture Autoload" entry to the tool panel in the Tools tab for texture paint, sculpt and vertex paint. There's a button to download everything from a folder. Another button is to remove all autoloaded textures that aren't being used.
    CG enthusiast. Tools: Blender - Substance - Unity3D



  18. #18
    uh i did not get any message to this thread and missed all comments about it not workking i will put it on my menu to fix the functionality, thanks for reporting.



  19. #19
    When I try adding your addon Blender Console says it does not have UTF-8 encoding. I am very interested in your add-on, maybe it is because of 2.78 blender maybe?



  20. #20
    thanks for your interest, i was looking into this but it seems there is some issue with the versions, i have a newer one that the one that comes with blender. i will see if i figure it out whats going on there.

    untli then you can get the latest version from here: https://github.com/kromar/Blender_Ad...rt_BrushSet.py



Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •