Would it be possible to run the code (that is coming from NodeBox) inside Blender (that is scriptable with python)?
The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.
General DiscussionFrom the old forum
NodeBox and Blender
-
-
NodeBox team Not directly, no. The issue is the drawing library: we don't have a graphics API that is compatible with Blender's graphics API.
If we (or someone from the community) could provide a bridge that links the two, then it would be possible.
-
Hi Frederik De Ble...,
I study the code of Nodebox because I need a python lib for create an addon that use a palette pie with Harmonies pattern like triade or opposite color etc...
Is it a possibility to code a blender drawing lib to draw with the colors lib of Nodebox?
or is it possible to use Nodebox OpenGL for that (with python and java)."colors lib" is amazing and simple. but contain drawing function from coca for MAC.
If the drawing lib would be for blender: bpy, bgl, and blf, we must re-writte all the colors lib, no?
I am very interesting to discuss with you about that, please?
friendly.
Patrick Depoix
aka Spirou4D (blenderartist.com) -
NodeBox team It's been a while since I've looked at the colors library, but AFAIK it would be possible to just use the color harmony algorithms (which return simple Python data structures) without using the drawing part (which would use the NodeBox drawing API).
Is there a specific error you run in to?
-
It's been a while since I've looked at the colors library, but as far as
I know it would be possible to just use the color harmony algorithms (which
return simple Python data structures) without using the drawing part (which
would use the NodeBox drawing API).but "ximport" don't run with python because ximport is special to nodebox
and colors/init.py :
try:
# NodeBox / Cocoa specific functionality.
# Our library can still do a lot of interesting stuff without these!
from nodebox.graphics import Grob, RGB, HSB, CMYK, CORNER
from nodebox.graphics.cocoa import _restore, _save
from AppKit import NSShadow, NSColor
from AppKit import CIImage, CIColor, CIFilter, CIVector,
NSGraphicsContext
except:
class Grob: passThis don't be used but I have a traceback with it!
And I tried the first "colors example 1" and I must rewrite the import code
like this:try:
colors = import("colors")
except ImportError:
colors = import("init")
#reload(colors)BUT "reload(colors)" don't run on my Python 3,5!!! Do you have a solution,
please?I tried this "exec.module(colors)" but don't run too!
Excuse me if I speak of details problems. I wanted to speak only about the
use of the code with standart python: You answer me there are not problem
with drawing module so I will try to code my custom bpy, bgl, blf, module
for your colors module.
Thanks
At soon.Patrick Depoix
Patrick Depoix φArchitecte D.P.L.G.Historien-chercheur en histoire de
l'ArchitectureEx-Maître de conférence de l'Ecole d'Architecture de
Lille-Région Nord
Recherche en cours: Cimetière Brion.
https://plus.google.com/u/0/+PatrickDepoix/posts/7kLH8yzKpUhhttp://www.linkedin.com/
http://www.linkedin.com/pub/patrick-depoix/40/b3b/542
http://www.linkedin.com/profile/view?id=146146370&authType=name&authToken=m19Q&pvs=pp136,
rue d'Esquermes59000 LilleFranceTel (+33/0) 952 51 33 25
Fax (+33/0) 957 51 33 25Port (+33/0) 06 23 13 73 71Skype:oikakeruPour
répondre --> Mailto:patrick.depoix@free.fr
http://--- http//www.linkedin.com/pub/patrick-depoix/40/b3b/542 Patrick Depoix Architecte D.P.L.G. Historien-chercheur en histoire de l'Architecture Ex-Maître de conférence de l'Ecole d'Architecture de Lille-Région Nord136, rue d'Esquermes 59000 Lille France Tel (+33/0) 952 51 33 25 Port (+33/0) 06 23 13 73 71 Fax (+33/0) 826 70 04 40 Skype:oikakeru Pour répondre --> Mailto:patrick.depoix@free.fr -
Hi,
After installed colors folder in Blender python/lib/site-packages/
and run blender and in console windows, I typed this:colors = import('colors')
clr2 = colors.olive()Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "<string>", line 50, in <lambda>
File
"C:\Users\lenovo\Downloads\BLENDER\APPLICATION\blender-2.79-rc2-windows64\2.79\python\lib\site-packages\colors_init_.py",
line 640, in init
elif kwargs.has_key("mode")
AttributeError: 'dict' object has no attribute 'has_key'=> I don't understand why there are an error?
-
OK Frederick,
I corrected the code with python 3.0 functions because "has_key" for
example is removed now!
And the new code run:$ colors = import('colors')
$ clr1 = colors.olive()
$ print(str(clr1))
$ Color(0.500, 0.500, 0.000, 1.000)So I will continue to obtain the code run correctly for python 3.6....
Thanks.Friendly.
Patrick DepoixPatrick Depoix φArchitecte D.P.L.G.Historien-chercheur en histoire de
l'ArchitectureEx-Maître de conférence de l'Ecole d'Architecture de
Lille-Région Nord
Recherche en cours: Cimetière Brion.
https://plus.google.com/u/0/+PatrickDepoix/posts/7kLH8yzKpUhhttp://www.linkedin.com/
http://www.linkedin.com/pub/patrick-depoix/40/b3b/542
http://www.linkedin.com/profile/view?id=146146370&authType=name&authToken=m19Q&pvs=pp136,
rue d'Esquermes59000 LilleFranceTel (+33/0) 952 51 33 25
Fax (+33/0) 957 51 33 25Port (+33/0) 06 23 13 73 71Skype:oikakeruPour
répondre --> Mailto:patrick.depoix@free.fr
http://--- http//www.linkedin.com/pub/patrick-depoix/40/b3b/542 Patrick Depoix Architecte D.P.L.G. Historien-chercheur en histoire de l'Architecture Ex-Maître de conférence de l'Ecole d'Architecture de Lille-Région Nord136, rue d'Esquermes 59000 Lille France Tel (+33/0) 952 51 33 25 Port (+33/0) 06 23 13 73 71 Fax (+33/0) 826 70 04 40 Skype:oikakeru Pour répondre --> Mailto:patrick.depoix@free.fr=============================================================
-
NodeBox team Hi Patrick,
Do you by any chance have a list of fixes that we could apply to the colors library to have it work in Blender and Python 3?