Code Monkey home page Code Monkey logo

blenderconsoleprompt's Introduction

zen_cms

a small cms that takes .txt files or .markdown files.

edit zen_cms.js script_table to order the links of the sidebar. like:

var script_table = {};
script_table['Edge_Tools_VTX'] = "Edge_Tools.txt";
script_table['Add_Vertex'] = "Add_Vertex.txt";
script_table['On_Comments'] = "On_Comments.markdown";

let zen_cms.js do the rest. visit zeffii.github.io

blenderconsoleprompt's People

Contributors

gitter-badger avatar zeffii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blenderconsoleprompt's Issues

Setting Text of "Active FrameNode"

i think

aft; Initial Shape, translated

aft; should start a listener, any text thereafter should be stripped and added to the active FrameNode if there is one present.

Default commands

these are the non modal, one shot commands

Command String Description
cen centers 3d cursor
cen=some_value where some value can be evalled, 3d cursor will be placed at it
string! anything followed by an exclamation mark is copied to buffer
vtx sees if tinyCAD is enabled and performs VTX, (or first enables it)
xl (XL) sees if tinyCAD is enabled and performs XALL, (or first enables it)
ico sees if developers icons addon is enabled (enables if not)
wipe un-links and removes objects, and all meshes
tt turntable
tb trackball
syntax sets text editor to syntax highlighting, wrap, linenumber, margin

feature - "rend anim /path/to/"

i'm thinking it would be neat to be able to type

>>> rend anim /some/path/

and have the console automatically set the Output directory to /some/path/ and make it if it doesn't exist yet. I don't think autocomplete for the paths will be possible without more work than I wish to put in..

would love to have something like pipes

>>> rend anim /some/path/ | gif fps=20 outputname | optimize

add git commands, i forget!

There are only a few commands that anyone needs to know

git pull --all
git push --all
git add --all
git add <specify file>  # do this from inside the right directory
git commit -am "commit message here"
git checkout -b <branch_name>  # new_branch_name_based_on_current_branch
git branch -D <branch_name> # deletes branch locally (you must be on a different branch first)
git branch

# be in master, or branch to merge into
    git merge <branch_to_merge>
    git push --all

note to self - mklink on windows

mklnk /d "DESIRED_LOCATION" "CURRENT_LOCATION"

mklnk /d "C:\Users%username%\AppData\Roaming\Blender Foundation\Blender%BLENDER_VERSION_NUM%\scripts\addons\BCP" C:\some\directory\BCP

xp. has to be different...:   `ln -j source destination`
http://schinagl.priv.at/nt/ln/ln.html
usage: ln [-s|-j] <target> <linkname>

linux - ln link

one line

ln -s ~/Desktop/GITHUB/BlenderConsolePrompt-master/addons_contrib/BCPrompt ~/Downloads/BLENDER_NEW_TRUNK/blender-2.74-997c0c8-linux-glibc211-x86_64/2.74/scripts/addons_contrib/

Adding key combo to UserPreferences/Input/Console has bug

This might be a Blender bug, but the scenario is :

  • add console.do_action to operators with any key combo (doesn't matter, not that it should matter)

notice that console.execute ( Enter, or numpad Return) has disappeared. The only solution I found was to

  • add console.do_action
  • then add console.execute back.

A more serious attempt at package / addon manager a la npm

Code exists already for checking if an addon can be enabled. Blender returns {'CANCELLED'} if addon isn't found:

    elif m.startswith('enable '):
        command, addon = m.split()
        t = bpy.ops.wm.addon_enable(module=addon)
        if t == {'FINISHED'}:
            msg = 'enabled {0}'.format(addon)
        elif t == {'CANCELLED'}:
            msg = 'addon not enabled, is it spelled correctly?'
        add_scrollback(msg, 'INFO')

The problem with that is, well, who can remember full addon names? I can't.. This means making a dict of addons mapping to their full names.. something like

# this to be used for addons which are definitely present..
lazy_dict = {
    '-imgp': [addon_enable, "io_import_images_as_planes"],
    '-bb2': [addon_enable, "BioBlender"],
    '-idxv': [addon_enable, "view3d_idx_view"]
}

and my super lazy 'enable if present, or download and enable if not'

def lazy_power_download(mod, dl_url, op_path, op_name):
    registers_operator = [op_path, op_name]

    packaged = dict(
        operator=registers_operator,
        module_to_enable=mod,
        url=dl_url
    )

    test_dl_run(packaged)

where test_dl_run is this monstrocity..

def test_dl_run(packaged, invoke_type=None):
    '''
    This implementation:
    - test if the operator already exists in bpy.ops.xxxx
    - if yes, run
    - if no, try (enable and run).
    - if failed to enable then the packaged dict includes a download url
    - attempts a download and then (enable and run)

    Restrictions:
    - Expects only a single download file not a folder structure yet.
    '''

    _ops, _name = packaged['operator']
    _module = packaged['module_to_enable']
    _url = packaged['url']

    # first check if the operator exists.
    addon_enabled = _name in dir(_ops)

    def run_addon(_ops, _name, invoke_type):
        if invoke_type:
            getattr(_ops, _name)(invoke_type)
        else:
            getattr(_ops, _name)()

    if not addon_enabled:
        try:
            bpy.ops.wm.addon_enable(module=_module)
            # getattr(_ops, _name)()
            run_addon(_ops, _name, invoke_type)
            return
        except:
            print('\'{0}\' addon not found.'.format(_module))
            print('will attempt download: ')

            # I only want the shortest path.
            script_paths = bpy.utils.script_paths()
            sp = list(sorted(script_paths, key=len))[0]
            contrib_path = os.path.join(sp, 'addons_contrib')

            if not os.path.isdir(contrib_path):
                print('attempting to make path...')
                shutil.os.mkdir(contrib_path)

            # path should exist now.
            print('downloading from:', _url)
            filename = _url.split('/')[-1]
            py_destination = os.path.join(contrib_path, filename)
            urlretrieve(_url, py_destination)

            # must happen or the new script isn't found.
            bpy.utils.refresh_script_paths()

        # try one last time to enable and run.
        try:
            bpy.ops.wm.addon_enable(module=_module)
            # getattr(_ops, _name)()
            run_addon(_ops, _name, invoke_type)
            return
        except:
            msg = 'blender console has failed miserably, let me know'
            print(msg)

    else:
        # the ops is present, just call it.
        print('STEP 6 operator is present, simply call operator')
        # getattr(_ops, _name)()  # get and call
        run_addon(_ops, _name, invoke_type)

match b28 cursor3d to empty transforms

# add match 3d cursor to selected
import bpy
obj = bpy.context.active_object

if obj.type == 'EMPTY':

    copy_attrs = 'location rotation_euler'.split()
    cursor_3d = bpy.context.scene.cursor

    for attr in copy_attrs:
        attr_val = getattr(obj, attr)
        setattr(cursor_3d, attr, attr_val)

expects euler.

mini todo list

< > means optional

  • make bash executor for convert and gifsicle sequence
  • add size check after rendering to gif (display size of any gifs found in /path/ - render.render.filepath)
    >>> size </path/>
  • experiment with uploading to gifycat and copy the generated url ( http://gfycat.com/api )
    >>> gcat /path/desired_image.gif
  • add BlenderPythonRecipes to pop up browser at github.com/zeffii/BlenderPythonRecipes/wiki
    >>> bpr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.