Comments (15)
print(bpy.context.space_data.node_tree.name)
works, so will use that.
from sverchok.
node.id_data.name
from sverchok.
maybe my eyes deceived me, but I thought that was returning the node name as opposed to the tree name. weird.
from sverchok.
>>> D.node_groups['MyNodeTree'].nodes['Viewer Draw.003'].id_data.name
'MyNodeTree'
from sverchok.
great!
On Mon, Apr 28, 2014 at 10:11 AM, ly29 [email protected] wrote:
D.node_groups['MyNodeTree'].nodes['Viewer Draw.003'].id_data.name
'MyNodeTree'—
Reply to this email directly or view it on GitHubhttps://github.com//issues/111#issuecomment-41532901
.
from sverchok.
I think best way to do the larger task you mention is to have a something like a layer manager in the right toolbar.
so in the class SverchokToolsMenu(bpy.types.Panel): node_Tool.py
for i,name in enumerate(bpy.node_groups.keys()):
row=layout.row()
row.layout(text=name)
row.prop(bpy.node_groups[name], "animate", text="Animate?")
And we add the bool property in node_s.
And furthermore we can make update_ani function that updates the tree without rebuilding like update does since that is for editor changes.
from sverchok.
In fact I will to that this right now.
from sverchok.
yes, this makes sense! I was going a different route, but not as sophisticated as your approach.
from sverchok.
It also strikes me that we could have option to show the many node groups or not. instead of animate.
@nortikin Any comments?
layout.label(text="Animation layers")
ng = bpy.data.node_groups
for name in ng.keys():
if ng[name].bl_idname == 'SverchCustomTreeType':
row=layout.row()
row.label(text=name)
row.prop(ng[name], 'sv_animate', text="Animate?")
The snippet would become something like.
def my_handler(scene):
for name,tree in bpy.data.node_groups.items():
if tree.bl_idname =='SverchCustomTreeType':
tree.update_ani()
bpy.app.handlers.frame_change_pre.append(my_handler)
where update_ani() works like
def update_ani(self):
if self.sv_animate:
speedUpdate(tree_name = self.name)
from sverchok.
The layout needs to be adjusted.
from sverchok.
Something more like this seems better.
from sverchok.
box=layout.box()
box.label(text="Layers")
ng = bpy.data.node_groups
col=box.column(align=True)
row=col.row(align=True)
row.label(text='Name')
row.label(text='Show')
row.label(text='Animate')
for name in ng.keys():
if ng[name].bl_idname == 'SverchCustomTreeType':
row=col.row(align=True)
row.label(text=name)
row.prop(ng[name], 'sv_animate',text=' ')
row.prop(ng[name], 'sv_animate',text=' ')
Note that right now animate and show are the same option, that would obviously have to be changed.
from sverchok.
Of course ViewerDraw and other nodes that draw or bake would have to be updated also. And a bake options perhaps would be good also. Things get more complex so easily. I will stop now waiting for comments.
from sverchok.
previusly i supposed the it will be only button, but now it looks more "professional" or something like that.
It suits me, cool approach to handle animation update with boolean.
Lets call it layouts, because layers - is something different
Do you mean, that viewer draw and bakery should be hided if not flag on?
Somehow i binded viewer draw to tree name and node name, but from 3d view data disappear if you change layout and if in new layout there is node with the same name.
from sverchok.
Look #112
from sverchok.
Related Issues (20)
- Export to GIST seems to no longer working? HOT 1
- Viewer Draw under Bgl replacement HOT 1
- Mesh Clustering, new Node (Proposal)
- The new "Get Objects Data" node broke backward compatibility and usability HOT 8
- Sverchock build action errors
- Replace params to input sockets of Mesh Clustering node
- Mesh Clustering glitches
- Node Mesh Clustering use to many dependencies.
- Extend functionality of Mesh Clustering Node
- Can't install Cython compiled version of GeomDL or PyMCubes in Blender 4.1 because `--install-option` is depreciated in Python 3.11.7. HOT 3
- Dual Mesh Node Extended Algorithm
- Get Objects Data node. Add output sockets for Seams and Sharp edges HOT 7
- Circular import error in 4.2 Nightly HOT 11
- Quadriflow node
- Sverchok Viewer Draw node not working
- mixed up category and subcategory names in nodes shift-a menu
- Fix Voronoi On Mesh parameter Output Nesting HOT 2
- [Need Help] How to create Gyroid mesh? HOT 2
- Adaptive Edges HOT 1
- Error when trying to change fonts in Typography Viewer. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sverchok.