Skip to content

Instantly share code, notes, and snippets.

@nortikin
Created May 8, 2014 00:14
Show Gist options
  • Save nortikin/8f75694171ef6cdeff90 to your computer and use it in GitHub Desktop.
Save nortikin/8f75694171ef6cdeff90 to your computer and use it in GitHub Desktop.
init.py
# ***** 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, see <http://www.gnu.org/licenses/>
# and write to the Free Software Foundation, Inc., 51 Franklin Street,
# Fifth Floor, Boston, MA 02110-1301, USA..
#
# The Original Code is Copyright (C) 2013-2014 by Gorodetskiy Nikita ###
# All rights reserved.
#
# Contact: sverchok-b3d@yandex.ru ###
# Information: http://nikitron.cc.ua/sverchok.html ###
#
# The Original Code is: all of this file.
#
# Contributor(s): Nedovizin Alexander, Gorodetskiy Nikita, Linus Yng, Agustin Gimenez.
#
# ***** END GPL LICENSE BLOCK *****
#
# -*- coding: utf-8 -*-
bl_info = {
"name": "Sverchok",
"author": "Nedovizin Alexander, Gorodetskiy Nikita, Linus Yng, Agustin Jimenez, Dealga McArdle",
"version": (0, 2, 8),
"blender": (2, 7, 0),
"location": "Nodes > CustomNodesTree > Add user nodes",
"description": "Do parametric node-based geometry programming",
"warning": "requires nodes window",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.7/Py/Scripts/Nodes/Sverchok",
"tracker_url": "http://www.blenderartists.org/forum/showthread.php?272679-Addon-WIP-Sverchok-parametric-tool-for-architects",
"category": "Node"}
import sys,os
path = sys.path
flag = False
for item in path:
if "sverchok" in item:
flag = True
if flag == False:
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'sverchok_nodes'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'sverchok-master'))
print("sverchok_nodes: added to phytonpath :-)")
### not tested yet:
modo= [name.split(".py")[0] for name in os.listdir("nodes") if name.endswith(".py")]
modules = {}
for modu in modo:
modules[modu] = __import__(modu)
def register():
import bpy
import nodeitems_utils
for i in modules:
i.register()
if 'SVERCHOK' not in nodeitems_utils._node_categories:
nodeitems_utils.register_node_categories("SVERCHOK", node_s.make_categories())
def unregister():
import bpy
import nodeitems_utils
for i in modules:
i.unregister()
if 'SVERCHOK' in nodeitems_utils._node_categories:
nodeitems_utils.unregister_node_categories("SVERCHOK")
if __name__ == "__main__":
register()
#import nodeitems_utils
#if 'SVERCHOK' in nodeitems_utils._node_categories:
#unregister()
#else:
#register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment