Coder Social home page Coder Social logo

Comments (15)

zeffii avatar zeffii commented on July 30, 2024

print(bpy.context.space_data.node_tree.name) works, so will use that.

from sverchok.

ly29 avatar ly29 commented on July 30, 2024

node.id_data.name

from sverchok.

zeffii avatar zeffii commented on July 30, 2024

maybe my eyes deceived me, but I thought that was returning the node name as opposed to the tree name. weird.

from sverchok.

ly29 avatar ly29 commented on July 30, 2024
>>> D.node_groups['MyNodeTree'].nodes['Viewer Draw.003'].id_data.name
'MyNodeTree'

from sverchok.

zeffii avatar zeffii commented on July 30, 2024

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.

ly29 avatar ly29 commented on July 30, 2024

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.

ly29 avatar ly29 commented on July 30, 2024

In fact I will to that this right now.

from sverchok.

zeffii avatar zeffii commented on July 30, 2024

yes, this makes sense! I was going a different route, but not as sophisticated as your approach.

from sverchok.

ly29 avatar ly29 commented on July 30, 2024

animation-layers

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.

ly29 avatar ly29 commented on July 30, 2024

The layout needs to be adjusted.

from sverchok.

ly29 avatar ly29 commented on July 30, 2024

layers2
Something more like this seems better.

from sverchok.

ly29 avatar ly29 commented on July 30, 2024
        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.

ly29 avatar ly29 commented on July 30, 2024

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.

nortikin avatar nortikin commented on July 30, 2024

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.

ly29 avatar ly29 commented on July 30, 2024

Look #112

from sverchok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.