KingChaos Posted June 4 Share Posted June 4 hi, how i can call the record name of a red symbol, placed with a marionett network. i need to place red symbols and put some parameters into them. Which nodes i have to use for this? BR KC Quote Link to comment
Pat Stanford Posted June 4 Share Posted June 4 The SetRecordField node in the Record and IFC category will let you store values to record.field. I don't see a node for getting the required name of the parameter record. The Vectorscript to get this would be: GetName(GetParametricRecord(YourHandle)); This should give you a string representing the name of the record that you can use in the SetRecordField node. Sorry, but I don't have time to make a node today. Quote Link to comment
KingChaos Posted June 5 Author Share Posted June 5 ah ok, i made it with chatGPT. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( "Get Record Name" ) this.SetDescription( 'Returns the value of a data record field. If the data record does not exist or is not attached, it returns false' ) #Input Ports inObj = Marionette.PortIn( vs.Handle(0), 'hObj' ) inObj.SetDescription( "The input object" ) #OIP Controls #Output Ports obj = Marionette.PortOut('hObj') obj.SetDescription( "The original object" ) recName = Marionette.PortOut('sRecName') recName.SetDescription("The name of the attached record") #BEHAVIOR def RunNode(self): # functions def getRecName(objHan): # This function returns the name of the first record attached to ObjHan, else an empty string totalRecCount = vs.NumRecords(objHan) if totalRecCount > 0: locRecHan = vs.GetRecord(objHan, 1) locRecName = vs.GetName(locRecHan) return locRecName return '' # inputs inObj = self.Params.inObj.value # script recName = getRecName(inObj) # outputs self.Params.recName.value = recName self.Params.obj.value = inObj it returns 1 record name. i failed to add an output with a list of the field names of this record. Then i tried to list all attached records, but that does not work too. 😞 Quote Link to comment
KingChaos Posted June 5 Author Share Posted June 5 i needed the name of the field, because it seems not to be the name i called the input node which is in the oip. is there any different way, to manipulate the OIP parameters of marionettes placed red symbols? i thought they were record based, maybe this is not the right way to do it. symbole am strang V2.vwx Quote Link to comment
KingChaos Posted June 5 Author Share Posted June 5 i think best would be, i get a really good tutorial for "making nodes". sry for my lack of everything ^^ Quote Link to comment
Marionette Maven Marissa Farrell Posted June 5 Marionette Maven Share Posted June 5 There's no way to update the OIP values of Marionette objects in the Shape Pane from another script, if you create Marionette Objects that get their values from Record Values, then you can change them from worksheets, scripts, etc. Can you give me a better description of what you're hoping to do with the file you've attached, or even just what you're trying to do generally? It's possible to create a Marionette object that will draw based on record field values, but it would require setting up its own record format and would not be bidirectional with the record values and OIP Shape Pane values. What this would mean is that if you want OIP (shape pane) values, you can't modify the shape of the object with the record, but if you're okay only modifying record fields to affect the object, then you could do all edits in the Data Pane or within database worksheets, etc. (this would mean no parameters will appear in the Shape Pane of the OIP) Otherwise, you can use the OIP (shape pane) values to set the record values, but you cannot update the OIP (shape pane) values from editing the record. Quote Link to comment
KingChaos Posted June 6 Author Share Posted June 6 all i wanna do is placing object nodes and modify the oip values, but this is generally not possible? Quote Link to comment
KingChaos Posted June 7 Author Share Posted June 7 i want to make an object node, which places red symbols like this behind each segment of a named polygon. i need to put the segments length into the red symbols. with xg cabinets its working very good, except some unwanted behavior. Therefore i read out the "record" of the red symbols and found but it seems, that there are no fields with the data i need. So i need to remake the red symbol to make it be dynamic with a database? The red symbol is not that easy. You saw it before. But i dont know how to make the symbol react like now AND having a record with all the oip inputs. Quote Link to comment
Marionette Maven Marissa Farrell Posted June 7 Marionette Maven Share Posted June 7 There's a difference between how the XG Cabinets and a custom Marionette Object would work. The XG Cabinet is a Plug-in Object and was created with records and fields that relate to the parameters, and Marionette is able to access these values using the nodes as you've done with your other file. Marionette Objects are not created the same way. They are not the same type of PIO, they're created using the Python API which was wrapped up in Marionette nodes. There's currently no direct relationship with the parameters exposed to the OIP and the record you're seeing when you request an attached record; that record is just part of the Marionette PIO, not what is created by it. Here's a screenshot showing the fields that are in the Record Format you've queried, none of which relate to the parameters in the OIP: As I mentioned before, the Marionette Network could be written to attach a custom Record Format and store values from the OIP as Record Fields, or just allow users to manipulate the Record Fields to define the Marionette object, but there is currently no way to have the same bi-directional relationship that traditional PIOs have with OIP Parameters and Record Fields. To do what you're hoping, you will have to edit the Marionette Network inside the Marionette Object Style to define the new relationships. 1 Quote Link to comment
Mirko Guhr Posted September 14 Share Posted September 14 Hallo @KingChaos, first of all, I must mention that the areas we are about to delve into are complex and cannot be managed without proper debugging. The relevant knowledge should also be present to some extent to be able to assess any errors that occur. @Marissa Farrell has already explained it well regarding the databases. I will also briefly add my contribution here: Basically, the database is a trash can. It takes in data and spits it out again. In the normal Marionette objects, if the database is linked, the object writes certain values into this database, usually controlled by the OIP. The “set record field” can be integrated into the network for this purpose. It is not possible for the database to change the object without further ado. And here we are at the topic. Without further ado: attached you will find your adjusted file There are two nodes from @DomC, get/set Marionette OIP Field. Get and Set Marionette OIP Parameter I had to modify these nodes a bit because I couldn’t manage to read/write the OIP strings. Maybe it’s a version issue or I’m doing something wrong. But they work for you now 😉. Also, without the “End + Update” or Pass that I wrote, not much happens. The script updates the values in the objects, but the objects themselves need to be updated. To remove this manual process, this node is placed at the end. Maybe there’s a purpose where the Pass is useful. I still need to write an article and debug the node more thoroughly. So be warned!!! Not all values like to be updated. Together with the record fields, endless possibilities arise for writing, reading, processing, and reproducing in the object. Final word: It is important to clean up at the end and know where the data is processed to decide how the logic of the entire project looks. It doesn’t make sense to have the complete script in all objects. I prefer to distinguish between “active” and “passive” networks. An active network is the pillar for me. Here, only data that must really be actively influenced by this object is visible and stored, and can only be entered at this point, i.e., in the object itself, usually in the OIP. Otherwise, I try to keep it as passive as possible to preserve performance. A passive network would be a menu command that is only executed when the user manually triggers it. Only then are the final data processed. Not in between while the pillar is constantly being moved from A to B. I hope I could help you a bit and wish you much success and good luck. {Moderator note: Incorrect file uploaded so removed. Check further down in this thread for the download Pat Stanford} Best regards 1 Quote Link to comment
DomC Posted September 14 Share Posted September 14 @Zuzzla Thanks for noting that. After all this is right. The node uses the key varName which represent the internal name. the key 'text' represents the visible parameter name. Because i use "if name in varName" and not name == varName it worked for me while i always not check with the full name. However the "text" key was the right one to use. 1 Quote Link to comment
Mirko Guhr Posted September 15 Share Posted September 15 @KingChaos, When pulling out the Update Node, I briefly pressed the button again. I noticed that I cleaned up too much of the file at the end. Forgive me 😉. I didn’t want to upload 18 MB to the server. However, I also killed the basic form of the Marionette. Therefore, here is the slim and clean file again. Best regards symboleAmStandZuzzla.vwx 1 Quote Link to comment
Recommended Posts
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.