Jump to content
Developer Wiki and Function Reference Links ×

Marionette file doesn't work when pulled into a new file?


Recommended Posts

Hi If possible could somebody check this Marionette file please, it doesn't work at all when inserted into a new file from the resource pallet but works when I copy it, could somebody check this and tell me where I might have gone wrong or if I am overcomplicating things. it seems like a fairly simple item but I have had to feed the materials, lengths and certain other properties in so the output displays correctly on the text and in the record items, could somebody kindly see if they can help me with this please as I am almost pulling my hair out trying to get these dynamic items working, also apologies for the larger file size most of this is because i am trying to embed all our finishes which are quite large, but I will be having a look into that and see if I can pull the finishes in a different way or reduce them a little in file size. Appreciate any help with this. 

Thank you,

Simeon

 

 

Aspen Modesty.vwx

Link to comment

I don't have time to chase it right now, but you are not providing an input to the Component input of the Set Material nodes.

 

The error you are getting is because the Set Material node is trying to do a comparison of a missing value to an integer and Python thinks they are different types and can't do it.

 

Try adding a value to those inputs, probably a constant of zero or one (0 or 1) should work.

 

No idea what it is running in your original file or why it works with copy/paste but not with import.

  • Like 1
Link to comment

thank you pat I appreciate you quickly looking into that, I have had to park that for a day or two to sort some project work but once I get back onto it, I will have a look. I did have all the nodes connected originally so maybe something has glitched out when I saved it because a few things were glitching when I was creating that. Could I ask whether doing this via Marionette or should I just create a vectorscipt or python coded tool / object item is the best way. I know we want to have these kind of dynamic options for stretching length and changing materials but I want to make sure I am going down the correct route. Thank you, Sim

Link to comment

@Marissa Farrell Care to comment on Marionette vs Script?

 

I don't do a lot in Marionette, so I can't make a good recommendation. I have definite opinions, but I have said before that I think Marionette is very good for creating objects. I am just not certain that in this case what you are asking for is within the capabilities of Marionette.

 

The network does not seem overly complicated (I have seen some with far more nodes), so Marionette is probably fine.

 

But I have been scripting for such a long time I would do it as a script just because the debugging is easier for me there.

 

If you have Pascal or Python programming experience, then you might want to move to a script. If not, and the object is not going to get much more complicated, then I would probably suggest staying in Marionette until/unless you find something you "NEED" that can't be done in M.

 

Good luck.

  • Like 1
Link to comment
  • Marionette Maven

It seems like your objects aren't keeping their names when you import them, but when you copy them, the names are remaining.

I think you'll need to consider a different way of referencing your base objects. One thing you could do is get the contents of the control geometry group and reference them based on stacking order. Another option would be to save these pieces as symbols and store them in your script group (so not control geometry) and then add placement nodes in your script (which would require defining insertion points, etc.).

I think using named parts will cause other headaches for you even just working in the same file. For example, if you duplicate this object in your file, the parts are all appended with "-2", etc., and that will cause issues when you edit the duplicated object parameters.

If you elect to go the symbol route, you'll need to extract the contents of the symbol definitions since you can't have conflicting textures when editing them.

I think either option is valid, and if you choose, I can try to mock up a simple example that can help you along.



With regards to wondering if scripting vs. Marionette would be the better option here, I personally believe that if you know how to script, that it's almost always the better option. I see Marionette as a hand-holding tool for users that aren't versed in scripting, which is why I always fight to keep our nodes and networks open-source instead of behind encryption so that users can use Marionette scripts to learn how to assemble scripts and progress into more text-based scripting. There have been a fair few instances where users/distributors/people internally at Vectorworks have wanted to allow users to encrypt their networks, but I see that as such a disservice to the user-base and I make my opinion known clearly each time.

The one advantage Marionette has in cases like this, as @Pat Stanford said, is that it can be much easier to work with objects. Having access to the control geometry group can make a big difference in the long run, you can still absolutely set up a Python/VS script in ways to mirror how control geometry is used (to my understanding, the control geometry and script groups are glorified path and profile groups), but those are more advanced concepts than just shoving some geometry in a group and getting to reference it by one node.

Link to comment

thank you @Marissa Farrell and @Pat Stanford i appreciate your help with this.

 

@Marissa Farrell if possible a basic example with symbols would be really helpful, if you think this might be the better way in marionette to do that, like you say I don't want to end up with name issues for the original items.

 

what I found when I used that item I had created from the resource browser from a workgroup library as a test, if I click the unstyle button for the item in a new file, the item goes back to working in that active file, I am guessing it somehow resorts to the original naming.

 

From what I had been creating today I had a feeling it was that named item that might be a problem after working on some other items, I had started to see a pattern with that, it is a pity that it is though and isn't just contained in the original object sub group without auto-renaming but I understand why it does as you need unique ids on everything, the other way I thought would be just create some nodes for the parts like the bracket that are created in script form and can just move and change those then I don't have any named items in and don't need to do it completely in script and can keep some of it in marionette form for other users to be able to edit the materials list.

 

my other thought was just to do it completely in script, so I might have a look into that myself as well, but the problem if I do it fully scripted will the average user be able to edit a material list to add new materials, where as the marionette is a little easier for the average user to see.

 

We are producing a lot of items and we want to be able to have this power of the dropdowns, resizing items, most of our items of furniture are just that where it will stretch either in X, Y or Z axis depending on width, depth or height and change finish and I want to preset everything.

 

I want to almost create a configurator for our items that all the users can use. I know it's a big job but a massive saving in the long run, especially if they add or remove materials quite a lot and if we have all the sizes available added in rather having to create each item, each size and permutation manually (as we do at the moment ) so it will save time in the long run.  I understand swift to a level and have done some objective-c in the past and when I looked into vs script for the debugging it looked feasible just certain things that would throw me, so I will have a go as well.

 

On a side note for either @Marissa Farrell or @Pat Stanford Is it possible in script form to fillet all edges of an extruded rectangle so you can then run a stretch width and depth on that scripted item and it keeps the radius the same? I am guessing you would just feed the width, depth and height in and that would set the width (width) and height (depth) of the 2d rectangle and then the height (top extrude) of the item then run the fillet on the end of that but only if fillet is available as a scriptable item, if not I am guessing I would just do as I did where I create the ends and then just stretch a rounded rectangle in the middle of those.

 

Appreciate any help with this.

 

Thank you,

Sim

Link to comment
20 minutes ago, TSG-Sim said:

On a side note for either @Marissa Farrell or @Pat Stanford Is it possible in script form to fillet all edges of an extruded rectangle so you can then run a stretch width and depth on that scripted item and it keeps the radius the same? I am guessing you would just feed the width, depth and height in and that would set the width (width) and height (depth) of the 2d rectangle and then the height (top extrude) of the item then run the fillet on the end of that but only if fillet is available as a scriptable item, if not I am guessing I would just do as I did where I create the ends and then just stretch a rounded rectangle in the middle of those.

If I am understanding you correctly, the answer is yes and no.  If you just write a script, then when you stretch the object, the fillets might change.

 

If you create a Plug-in Object (PIO) then you can control the script inside the PIO to redraw the object when it is stretched and then redo the fillets.

 

Doing the fillets in a script is relatively easy.

  • Like 1
Link to comment

I am going to be owing you both a drink for helping me with this, if you are ever in sunny Lancashire uk, let me know if your close to the senator group headquarters and I will take you for a drink  😀

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...