Code Monkey home page Code Monkey logo

Comments (11)

jchanvfx avatar jchanvfx commented on August 11, 2024 1

Hi @GTN0707,

In the NodeGraph class there's a set_acyclic() function you can set to True.
https://chantonic.com/NodeGraphQt/api/graphs/NodeGraph.html#NodeGraphQt.NodeGraph.set_acyclic

See also
https://chantonic.com/NodeGraphQt/api/nodes/BaseNode.html#NodeGraphQt.BaseNode.add_accept_port_type
https://chantonic.com/NodeGraphQt/api/port.html#NodeGraphQt.Port.add_accept_port_type

Cheers,
Johnny

from nodegraphqt.

GTN0707 avatar GTN0707 commented on August 11, 2024 1

Thank you @jchanvfx! Your work is amazing!

from nodegraphqt.

GTN0707 avatar GTN0707 commented on August 11, 2024 1

Thank you for your massive patience responding to me @jchanvfx! I really appreciate it.

I will look into those and see if I can figure out anything. Thanks again and have a wonderful day!

from nodegraphqt.

GTN0707 avatar GTN0707 commented on August 11, 2024 1

just want to drop in to report that I think I did it! yay! It was a pretty convoluted snow ball of changes... like you pointed out, apply_live_connection and pipeItem class. also everything related to PortTypeEnum logic under graph, viewer, serialize, deserialize, undo, redo, connected_ports, redraw_connected_pipes...
I don't have a programming background but diving into your library definitely motivated me to learn python! Thank you so much!

from nodegraphqt.

jchanvfx avatar jchanvfx commented on August 11, 2024 1

Awesome bro keep on keeping on 👍

from nodegraphqt.

jchanvfx avatar jchanvfx commented on August 11, 2024

Awesome Thanks 😀

from nodegraphqt.

GTN0707 avatar GTN0707 commented on August 11, 2024

I do have a follow up question:
What if all I want to constrain is the port type but want to leave port name and node type unconstrained?
{
'port_name': 'foo'
'port_type': PortTypeEnum.IN.value
'node_type': 'io.github.jchanvfx.NodeClass'
}

from nodegraphqt.

jchanvfx avatar jchanvfx commented on August 11, 2024

You don't have to specify a port constrain type just leave the NodeGraph with acyclic set to True

from nodegraphqt.

GTN0707 avatar GTN0707 commented on August 11, 2024

I assume you meant acyclic set to False right? So that we can have a cyclic graph?
If so yes I have done that. But I'm still not able to do same type port connections. E.g. IN to IN, OUT to OUT. I have cases where I have something like, IN01 connected to IN02 of the same node (shorting). or IN01 of node A connected to IN02 of node B. etc. and still have regular IN-OUT connections as well.
I haven't been able to trace down which part of code is preventing IN-IN, OUT-OUT connections.

from nodegraphqt.

jchanvfx avatar jchanvfx commented on August 11, 2024

hmm... ok I think you might have to make some tweaks to the NodeViewer.apply_live_connection

https://github.com/jchanvfx/NodeGraphQt/blob/main/NodeGraphQt/widgets/viewer.py#L992

but I'm not sure if it's possible to have the same port type connections as you have to rework the PipeItem class too. 😢

https://github.com/jchanvfx/NodeGraphQt/blob/main/NodeGraphQt/qgraphics/pipe.py#L24

from nodegraphqt.

MegaBanana avatar MegaBanana commented on August 11, 2024

just want to drop in to report that I think I did it! yay! It was a pretty convoluted snow ball of changes... like you pointed out, apply_live_connection and pipeItem class. also everything related to PortTypeEnum logic under graph, viewer, serialize, deserialize, undo, redo, connected_ports, redraw_connected_pipes... I don't have a programming background but diving into your library definitely motivated me to learn python! Thank you so much!

Hi, any chance you publish your code ?

from nodegraphqt.

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.