Skip to content

Commit

Permalink
Improving colormap support
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrunnels committed Dec 18, 2023
1 parent f98aa38 commit 35c08e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bleMD/bleMDColormaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ def get(self,pos):
g.append(igreen.get(k))
b.append(iblue.get(k))
return p, r, g, b

elif "colors" in cmap.keys():
p = []
r = []
g = []
b = []
for i,c in enumerate(cmap['colors']):
p.append(i/len(cmap['colors']))
mod = int(len(cmap["colors"])/32)
if not mod: mod = 1
for i,c in enumerate(cmap['colors'][::mod]):
p.append(mod*i/len(cmap['colors']))
r.append(c[0])
g.append(c[1])
b.append(c[2])
Expand Down
2 changes: 1 addition & 1 deletion bleMD/bleMDNodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def defaultSettings():
for scene in bpy.data.scenes:
scene.render.engine = 'CYCLES'

bpy.context.window.workspace = bpy.data.workspaces['Shading']
#bpy.context.window.workspace = bpy.data.workspaces['Shading']
for n in range(3,11): # This whole bit of code is hacky
for area in bpy.data.screens[n].areas:
if area.type == 'VIEW_3D':
Expand Down

0 comments on commit 35c08e8

Please sign in to comment.