Jump to content
Developer Wiki and Function Reference Links ×

modify "name node"


KingChaos

Recommended Posts

hey,

 

i tried to modify the "name node", in the following way with chatgpt:

 

remove the oip.control widget

add in string input "sName"

 

which will be the name of the object to get.

 

this is not working, because i cant do this by my own.

 

 

#Revised by MFarrell on 02/05/16
#Edited by KingChaos with ChatGPT 10/14/24
#Modified April 2017
@Marionette.NodeDefinition
class Params(metaclass=Marionette.OrderedClass):
    # APPEARANCE
    
    this = Marionette.Node('Name')
    this.SetDescription('Get a named object in the drawing')

    # Input Port
    sName = Marionette.PortIn('Input Value')
    sName.SetDescription('name of the object to get')

    # Output Ports
    obj = Marionette.PortOut('h')
    obj.SetDescription('The object with the specified name')


    # BEHAVIOR
    this.SetLinksObjects()

    def RunNode(self):
        # inputs
        obj = vs.GetObject(self.Params.sName.value)
        sName = self.Params.sName.value  # Get the input value

    
        # outputs
        self.Params.obj.value = obj
        self.Params.outputValue.value = sName  # Pass the input value to the output

 

can someone help me make this node working?

 

Or has someone a different node, which gets an named object if it exists?

poly delete name.vwx

Link to comment

Thanks a lot, yeah it works, but i see, that my marionette is not composing the lines i made if it is an object node.

 

i used the node without  duplicate and its working.

 

the networks works fine, the wrapper too, but in object node (thats what i need) its not composing the lines.

 

The problem is, if i change some of the segments length of my marionette, it wont modify the existing polygon, it creates a new one.

so i need to find the named polygon with the node, then rename it to a temp-name, and delete it?

 

If i object the node i can rotate the objectnode and i can change all lengths but the result is not a composed polygon as i need it.

 

image.thumb.png.80326891c99110470249d11adb9a6da3.png

 

maybe someone can explaine, whats so different in object nodes and wrappers, or how i have to make it to make it work well.

 

 

BR KC

9 segmentiges POlygon fuer Strangmoebel V8.vwx

Link to comment

1. The Compose node uses a Menu-Command. It works as long as it is not used inside a PIO Object. The reason why it does not work is, that you do not create any lines which you could compose.

Lines:
2. You try to create lines with start 0.0 and end 350.0. Instead you should insert a point (0.0,0.0) at start and end(350.0,350.0) as Example. 
3. You have a list of points in the right order. You could create directly a polygon with the node "Create 2D Poly"
image.thumb.png.7889e118c2b26d7fbcff84bd51f7c2de.png

image.png.11dff38052bedce79a3c8e33ad715019.png

 

Here two Variants to create the polygon. I would choose Variante B it the rest of the network do not need lines somewhere. Just the poly
This two Rectangles creates the same Polygon
image.thumb.png.eec4c69bea41f0eba82632b8a2870ad9.png

 

I mean 4 Nodes agains one single nodes which does the same (I counted the Attribute node in the Screenshot)
 

Edited by DomC
Link to comment

check, works well.

 

And how i will modify the color of a text, 

 

IF boolcheck Y/N make it green/red?

 

That wont work, i tried naively this, 

 

image.png.2015e6e7f888d4ed39f6a0520b69727a.png

problem for me, the attributes were set to some input, if i wanna make a bool decision what to make red or green, there has to be a different approach.

Link to comment

The node is called color input not color rgb
Normally the issue of disappearing objects it the 2D 3D Content that a PIO or a Symbol can have (do you have a PIO?)
It also depends if you have screen plane or layer plane as default, where your 2D Objects are places inside a PIO. For better control of where Planar Objects are placed you can use Set Planar ref (0 is screen plane and will be 2D Component of PIO) or set component group. Also discussed here.
 

 

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...