tag:support.nodebox.net,2012-11-01:/discussions/general-discussion/41-nodebox-and-blenderNodeBox: Discussion 2018-09-05T10:18:07Ztag:support.nodebox.net,2012-11-01:Comment/205630582012-11-09T08:39:40Z2012-11-09T08:39:40ZNodeBox and Blender<div><p>Not directly, no. The issue is the drawing library: we don't
have a graphics API that is compatible with Blender's graphics
API.</p>
<p>If we (or someone from the community) could provide a bridge
that links the two, then it would be possible.</p></div>Frederik De Blesertag:support.nodebox.net,2012-11-01:Comment/205630582017-08-23T17:19:40Z2017-08-23T17:19:41ZNodeBox and Blender<div><p>Hi Frederik De Ble...,</p>
<p>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...<br>
Is it a possibility to code a blender drawing lib to draw with the colors lib of Nodebox?<br>
or is it possible to use Nodebox OpenGL for that (with python and java).</p>
<p>"colors lib" is amazing and simple. but contain drawing function from coca for MAC.</p>
<p>If the drawing lib would be for blender: bpy, bgl, and blf, we must re-writte all the colors lib, no?</p>
<p>I am very interesting to discuss with you about that, please?<br>
friendly.<br>
Patrick Depoix<br>
aka Spirou4D (blenderartist.com)</p></div>Spirou4Dtag:support.nodebox.net,2012-11-01:Comment/205630582017-08-25T18:59:18Z2017-08-25T18:59:18ZNodeBox and Blender<div><p>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).</p>
<p>Is there a specific error you run in to?</p></div>Frederik De Blesertag:support.nodebox.net,2012-11-01:Comment/205630582017-08-27T07:55:02Z2017-08-27T07:55:02ZNodeBox and Blender<div><blockquote>
<blockquote>
<p>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<br>
return simple Python data structures) without using the drawing part (which<br>
would use the NodeBox drawing API).</p>
</blockquote>
</blockquote>
<p>but "ximport" don't run with python because ximport is special to nodebox</p>
<p><em>and colors/<strong>init</strong>.py :</em></p>
<p>try:<br>
# 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<br>
except:<br>
class Grob: pass</p>
<p>This don't be used but I have a traceback with it!</p>
<p>And I tried the first "colors example 1" and I must rewrite the import code<br>
like this:</p>
<p>try:<br>
colors = <strong>import</strong>("colors") except ImportError:<br>
colors = <strong>import</strong>("<strong>init</strong>") #reload(colors)</p>
<p>BUT "reload(colors)" don't run on my Python 3,5!!! Do you have a solution,<br>
please?</p>
<p>I tried this "exec.module(colors)" but don't run too!</p>
<p>Excuse me if I speak of details problems. I wanted to speak only about the<br>
use of the code with standart python: You answer me there are not problem<br>
with drawing module so I will try to code my custom bpy, bgl, blf, module<br>
for your colors module.<br>
Thanks<br>
At soon.</p>
<p>Patrick Depoix</p>
<p>Patrick Depoix *φ*Architecte D.P.L.G.Historien-chercheur en histoire de<br>
l'ArchitectureEx-Maître de conférence de l'Ecole d'Architecture de<br>
Lille-Région Nord<br>
Recherche en cours: Cimetière Brion.<br>
<a href="https://plus.google.com/u/0/+PatrickDepoix/posts/7kLH8yzKpUh">https://plus.google.com/u/0/+PatrickDepoix/posts/7kLH8yzKpUh</a></p>
<p><a href="http://www.linkedin.com/">http://www.linkedin.com/</a><br>
<a href="http://www.linkedin.com/pub/patrick-depoix/40/b3b/542">http://www.linkedin.com/pub/patrick-depoix/40/b3b/542</a><br>
<a href="http://www.linkedin.com/profile/view?id=146146370&authType=name&authToken=m19Q&pvs=pp">http://www.linkedin.com/profile/view?id=146146370&authType=name&authToken=m19Q&pvs=pp</a>136,<br>
rue d'Esquermes59000 LilleFranceTel (+33/0) 952 51 33 25<br>
Fax (+33/0) 957 51 33 25Port (+33/0) 06 23 13 73 71Skype:oikakeruPour<br>
répondre --> Mailto:<a href="mailto:patrick.depoix@free.fr">patrick.depoix@free.fr</a><br></p></div>Patrick Depoixtag:support.nodebox.net,2012-11-01:Comment/205630582017-08-27T10:08:45Z2017-08-27T10:08:46ZNodeBox and Blender<div><p>Hi,</p>
<p>After installed colors folder in Blender python/lib/site-packages/<br>
and run blender and in console windows, I typed this:</p>
<blockquote>
<blockquote>
<blockquote>
<p>colors = <strong>import</strong>('colors') clr2 = colors.olive()</p>
</blockquote>
</blockquote>
</blockquote>
<p>Traceback (most recent call last):<br>
File "", line 1, in File "", line 50, in File "C:\Users\lenovo\Downloads\BLENDER\APPLICATION\blender-2.79-rc2-windows64\2.79\python\lib\site-packages\colors_<em>init</em><em>.py", line 640, in __init</em>_<br>
elif kwargs.has_key("mode") \ AttributeError: 'dict' object has no attribute 'has_key'</p>
<p>=> I don't understand why there are an error?</p></div>Patrick Depoixtag:support.nodebox.net,2012-11-01:Comment/205630582017-08-27T18:25:27Z2017-08-27T18:25:28ZNodeBox and Blender<div><p>OK Frederick,</p>
<p>I corrected the code with python 3.0 functions because "has_key" for<br>
example is removed now!<br>
And the new code run:</p>
<p>$ colors = <strong>import</strong>('colors') $ clr1 = colors.olive() $ print(str(clr1)) $ Color(0.500, 0.500, 0.000, 1.000)</p>
<p>So I will continue to obtain the code run correctly for python 3.6....<br>
Thanks.</p>
<p>Friendly.</p>
<h2><a name="patrick-depoix-" class="anchor" href="#patrick-depoix-"></a>Patrick Depoix</h2>
<p>Patrick Depoix *φ*Architecte D.P.L.G.Historien-chercheur en histoire de<br>
l'ArchitectureEx-Maître de conférence de l'Ecole d'Architecture de<br>
Lille-Région Nord<br>
Recherche en cours: Cimetière Brion.<br>
<a href="https://plus.google.com/u/0/+PatrickDepoix/posts/7kLH8yzKpUh">https://plus.google.com/u/0/+PatrickDepoix/posts/7kLH8yzKpUh</a></p>
<p><a href="http://www.linkedin.com/">http://www.linkedin.com/</a><br>
<a href="http://www.linkedin.com/pub/patrick-depoix/40/b3b/542">http://www.linkedin.com/pub/patrick-depoix/40/b3b/542</a><br>
<a href="http://www.linkedin.com/profile/view?id=146146370&authType=name&authToken=m19Q&pvs=pp">http://www.linkedin.com/profile/view?id=146146370&authType=name&authToken=m19Q&pvs=pp</a>136,<br>
rue d'Esquermes59000 LilleFranceTel (+33/0) 952 51 33 25<br>
Fax (+33/0) 957 51 33 25Port (+33/0) 06 23 13 73 71Skype:oikakeruPour<br>
répondre --> Mailto:<a href="mailto:patrick.depoix@free.fr">patrick.depoix@free.fr</a><br></p>
<p>=============================================================</p></div>Patrick Depoixtag:support.nodebox.net,2012-11-01:Comment/205630582017-11-15T16:59:34Z2017-11-15T16:59:34ZNodeBox and Blender<div><p>Hi Patrick,</p>
<p>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?</p></div>Frederik De Bleser