Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Todo (zeffii) #118

Closed
45 of 55 tasks
zeffii opened this issue Apr 29, 2014 · 221 comments
Closed
45 of 55 tasks

Todo (zeffii) #118

zeffii opened this issue Apr 29, 2014 · 221 comments
Assignees
Labels

Comments

@zeffii
Copy link
Collaborator

zeffii commented Apr 29, 2014

I'm drawing up this list to keep track of things I want to complete before other random stuff.

  • Node to turn (verts+edgpol) into dashed edges, creating new verts+edges (dropping polys)
    • exists as 'dashed_edges.py' in node_scripts/zeffii/
    • use a string representation, or pick from dropdown.
    • use slider for scale (scale is relative to world)
    • image
  • Script Node (Text Editor addon) to generate clone of current as current_file_CLONE_HHMM
    • This would enable something like a versioning system, especially useful for code experiments
      which may span several similar files sequentially or parallel.

(low priority)

  • profile node implement even spread on bezier spline using vector interpolation, this makes the node dependent on numpy. decide.
  • update Intersect Edges
    • add tolerance setting to Intersect Edges
    • add "touching" boolean (currently intersections are limited to X and not T )

(on hold, partially implemented or implemented but not committed)

  • 3d cursor node
  • Grease Pencil In node
    • select from all available grease pencil layers / strokes in the current .blend
    • After selection cache immediately?
  • Empty Node The Empty Node #188
  • finish 'inset specials' node (now a branch)
    • inset amount (relative, but absolute should be possible in some sense)
    • inner face (keep / remove)
    • axis vector + distance scalar to push inset vertices
      long term
  • 3d L-system Node (I implemented this as a nodescript, elfnor also introduced an alternative implementation as a proper Node)
  • plot stuff like http://stackoverflow.com/a/4687582/1243487

done, presently in beta

  • dump current node_tree to json, and generate from json.
  • Viewer Draw Extended
  • rounded rect using phymec's 0.3 code
  • Instancer Node Instance Array node (node musings) #208
  • barely beta stethoscope
    This node shouldn't go on as beta for too long. The main reason it's not on the fast-track to node-proper is because I'm not sure how to format the data usefully. With DebugPrint node it's easy: "just spit out the data". But with BGL render it needs to be formatted and rounded so as not to overwhelm user or processor. The problem is not displaying the data, it's how to display the data in an abbreviated form in a meaningful way.
  • Eval Node
    • add =eval_text (function, internal file, update)
    • add =read_text (internal_file)

done

  • Simple 2pt bezier node (single segment)
  • Simple 3pt arc node (single segment)
  • Vector Math 2 Node, add Scalar vector * x and vector * 1/x .
    • this node is essentially finished, but I will be tested for another while before it replaces the original vector math node.
    • this node is also getting performance boosts.
  • SN should have an example about how to refresh imports
    I didn't figure out until a few minutes ago that scripted node could load my own local
    python modules. This means i can offload some work to code written in my favourite Text Editor (Sublime) node_Script scripting details and examples #85 (comment)
  • make ui_operator example that deals with incoming socket data
  • Bmesh view revisit
    • ....pick new random mesh name
    • ....select all generated meshes
    • ....pick base material
  • Gtext node https://gist.github.com/zeffii/063763a6b5fc64544f4f
    • create bounds dict to map the width of each glyph
    • use spacing param to space relative to this.
    • prelim typeface
    • prelim drawing code
    • tokenizer for symbols (maybe \d = degree, \D = diameter, \r = radius ..etc)
    • transplant code into a donor node
    • make latin+cyrillic+extras remap.
    • build primary latin+cyrillic+extras font face
  • intersect edges node doesn't remove original edges, it should
  • fix generic node_script input, right now nested listed are not handled appropriately
  • debug print node ( printing incoming sockets directly to stdout, like viewer Text but without expectations of incoming data formatting ) done by @ly29 not commited yet
  • fix default node values for ScriptNode
  • update index viewer
    • add edges + faces to index viewer
  • make kb shortcut for TextEditor to convert sv_main defaults to a new in_scokets declaration
    def sv_main(verts=[], dist=1.1, strength=1.0):
    can easily be parsed and turned into in_sockets list.
  • ScriptNode to get regular import styles, ie: place imports before def sv_main(). having a new import per iteration was a bad idea from the start
  • ScriptNode to allow 'faux' operator buttons, to action functions.
  • Implement user defined background+vert+edge+face colours in the N panel (6 colours is too clunky for node UI)
@zeffii zeffii self-assigned this Apr 29, 2014
@zeffii zeffii added the todo label Apr 29, 2014
@ly29
Copy link
Collaborator

ly29 commented Apr 29, 2014

For index viewer:
Make use it node id as discussed to support more than one layout
Implement a disable_all_callbacks: see file nods_s and Viewer_Draw

@ly29
Copy link
Collaborator

ly29 commented Apr 29, 2014

I should also do a todo and maybe one: what on my mind re sverchok

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 29, 2014

i'll do what I can re idx viewer, you may have to show me what you mean with the node_id, and how to add it.

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 29, 2014

image

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 29, 2014

    def draw_buttons(self, context, layout):
        row = layout.row(align=True)
        row.prop(self, "activate", text="Show")
        row.prop(self, "draw_bg", text="Background")

        layout.separator()
        col = layout.column(align=True)
        row = col.row(align=True)
        row.active = (self.activate)

        row.prop(self, "display_vert_index", toggle=True)
        row.prop(self, "display_edge_index", toggle=True)
        row.prop(self, "display_face_index", toggle=True)

@ly29
Copy link
Collaborator

ly29 commented Apr 29, 2014

Either everybody just use hash(node) as key for callbacks etc or we define this in util.py. Which we can change if we need.

def node_id(node):
    return hash( node)

Then use that which is unique for the node instead of the self.name+self.id_data.name or self.name

        n_id = node_id(self)
        if self.old_nid != n_id:
            callback_disable(self.old_nid)
            self.old_nid = n_id

So we can disable callbacks on opening a new file.

def callback_disable_all():
    global temp_handle
    temp_list = list(temp_handle.keys())
    for name in temp_list:
        callback_disable(name)

Clean up handler in node_s

@persistent
def sv_clean(scene):
    # callbacks for node_Viewer
    import Viewer_draw
    Viewer_draw.callback_disable_all()

@nortikin
Copy link
Owner

  • this is
  • cool

@ly29
Copy link
Collaborator

ly29 commented Apr 29, 2014

Also check it the node group is active

        if not self.id_data.sv_show:
            callback_disable(n_id)
            return

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 29, 2014

image

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 29, 2014

I will optimize this as much as possible, but probably won't add automatic face index hiding if occluded (at least not initially)

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 29, 2014

image

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 29, 2014

@ly29 i'm not sure how to wedge that into my new code.. reads

@ly29
Copy link
Collaborator

ly29 commented Apr 29, 2014

Do not worry. I can put it in

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 30, 2014

This is as far as I want to take the current ScriptNode prototype. I have a few thoughts concerning the Node UI and making it easier to nuke the sockets and load a new fresh template. [import|reload|nuke]

@zeffii
Copy link
Collaborator Author

zeffii commented Apr 30, 2014

import re
k = "def sv_main(verts=[], dist=1.1, strength=1.0):"

def write_in_sockets_list(test_str):
    if not "def sv_main(" in test_str:
        return

    # get dict
    r = re.compile('(?P<name>\w+)=(?P<defval>.*?|\[\])[,\)]')
    k = [m.groupdict() for m in r.finditer(test_str)]
    print(k)

    # convert dict
    socket_mapping = {
        '[]': 'v'
        # assume more will follow
    }

    socket_members = []
    for variable in k:
        stype = variable['defval']
        sname = variable['name']
        shorttype = socket_mapping.get(stype, 's')
        list_item = str([shorttype, sname, {0}])
        l = list_item.format(sname)
        socket_members.append("   " + l)
    socket_items = ",\n".join(socket_members)
    declaration = 'in_sockets = [\n'
    declaration += socket_items
    declaration += "]"
    print(declaration)

f = write_in_sockets_list(k)
print(f)

will add to TextEditor soon.

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

i need this:
vector_out_node

@ly29
Copy link
Collaborator

ly29 commented May 1, 2014

List Input, Vector Input or to acess blender data?

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

the main thing is the pixel space. some of those more atomic nodes take up quite a bit of surface area..

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

@ly29 is there any way to store something like a dict per instance of a Node ?

@ly29
Copy link
Collaborator

ly29 commented May 1, 2014

Agree about pixel space. Blender nodes looks clumsy sometimes.
I doesn't seem to be possible, everything but bpy props become the same for the class, atleast when I tested it for text in. but a dict with first node as hash and then your dict works. node_dict={} then create with node_dict[node][key] etc

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

woah! I think that will speed up ScriptNode because right now I have to obtain the node_function on each update.

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

something like:
self.node_dict[hash(self)]['node_function'] = node_function ?

@ly29
Copy link
Collaborator

ly29 commented May 1, 2014

Yes.

@ly29
Copy link
Collaborator

ly29 commented May 1, 2014

Or since you are only storing one per node:
self.node_dict[hash(self)] = node_function
Unless the key is important.

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

making it a key allows me to do .get('node function', None)
and for some reason it seems like a good thing

@ly29
Copy link
Collaborator

ly29 commented May 1, 2014

True that.

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

these execute functions, is there a better way to get self/node ?
https://gist.github.com/zeffii/85f4e47f56c8d5bb7257

using the dict works nicely, but breaks existing node_groups that use ScriptNode

@zeffii
Copy link
Collaborator Author

zeffii commented May 1, 2014

committed :D

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

image

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

this is with a linear transition between two states of a set of input variables, the transition should be linear for some but not all. all cool and useful problems :)

https://www.dropbox.com/s/gjgkhmqx2lo5ckh/aviation_drome_014.blend (includes semi-vectorized petal_sin)

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

using a 2pt spline, or vector cubic interpolate , it is possible to emulate one of these:
image
but it would really be awesome to have access to that UI

@nortikin
Copy link
Owner

yes, i will love to have this in custom nodes too

cupola subdivision and rotation is rotating wrong. some screw or shifting appears. to make straight vertical vertices you need only
(180_(n[0]-1))/x
where x = 32_64 divisions horizontal
n[0] = 10 height segments
and join it formula to stop in range float for rotation of circles

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

ahh crap, I just realized Blender deletes Node layouts that don't have 'users' . wtf.

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

I wonder is it possible to automatically set fake_user to True for each node tree?

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

I see what you mean with the shifting:
image

@nortikin
Copy link
Owner

my blender not delete layouts with nodes

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

hmmm.. I need to press the F or blender will delete them when saving.

@nortikin
Copy link
Owner

hash 9337574
2.71
2014-06-25 18:36

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

very strange, I can only speculate why this happened now

@zeffii
Copy link
Collaborator Author

zeffii commented Jul 29, 2014

@zeffii
Copy link
Collaborator Author

zeffii commented Sep 9, 2014

hmm
image

@AgustinJB
Copy link
Collaborator

:O
Love it!

@zeffii
Copy link
Collaborator Author

zeffii commented Sep 9, 2014

will make dynamic vertex sizes work too. Useful for larger screens

@zeffii
Copy link
Collaborator Author

zeffii commented Sep 9, 2014

image

@nortikin
Copy link
Owner

nortikin commented Sep 9, 2014

yes, you did it, thnks. how did you shading?
don't forget of baking button (hidden by default or not)
And by default please, blue face color

@zeffii
Copy link
Collaborator Author

zeffii commented Sep 10, 2014

it uses the single point light source as implemented already in ViewerDraw, except with FloatVectorProperty pointing at the Normal.
baking will be added back, along with default blue, eventually.

@ly29
Copy link
Collaborator

ly29 commented Sep 10, 2014

Very nice, thought about using GLSL shaders?

@nortikin
Copy link
Owner

@zeffii
i searched in BGL and found some:

glMaterialf(0, GL_SHININESS, 1000)
glLightf(3, GL_SPOT_EXPONENT, 100)
glEnable(GL_LIGHTING)

but not know how to get working

@nortikin
Copy link
Owner

lets say, shaders in GL will be headake, but lighting is in. question is how to get working

@zeffii
Copy link
Collaborator Author

zeffii commented Sep 10, 2014

unfortunately my current hardware doesn't support GLSL shaders

@nortikin
Copy link
Owner

if there is ready solution... we need most simple case

@zeffii
Copy link
Collaborator Author

zeffii commented Sep 10, 2014

i don't know which is more efficient, lighting or handpainting polygons..
if lighting is added then also several Vector based light source (point light) need to be added?

@ly29
Copy link
Collaborator

ly29 commented Sep 10, 2014

Just color and simple shading will be enough. Also verify polygon data which can crash blender and or cause visual artifacts

@zeffii
Copy link
Collaborator Author

zeffii commented Sep 10, 2014

lights are not necessary, if we want lights then use bmesh viewer.

this node is not intended to replace ViewerDraw, but instead offer a complementary set of useful features, especially:

  • vertex color
  • vertex size
  • edge color
  • edge width
  • polygon light direction
  • show edges
  • show vertices
  • show polygons

@nortikin
Copy link
Owner

we need improve viewer draw completely. But if you making little improvements for now is enough

@nortikin
Copy link
Owner

@zeffii zeffii closed this as completed Aug 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants