Shortcut for renaming
All  1-10  11-20

Previous
Next
 From:  Iwan (OZX)
10510.11 In reply to 10510.10 
With this script for the object names :
script: /* Edit object name */ var pp = moi.ui.propertiesPanel; if (pp.show && pp.numSelectedObjects > 0) { pp.editName(); }

If I select all objects with the same name: I change the name of all objects.
If I select an object (or a surface) : I give it a new name.

With the script for the object styles :
script: /* Edit style of selected object */ var styleindex = moi.ui.propertiesPanel.styleIndex; var dialog = moi.ui.createDialog( 'EditStyleDialog.htm?index=' + styleindex ); dialog.window.doModal();

If I select all the objects of the same style: I change the name of the style (and its colour).
If I select an object : I change the name of the style (and its colour).

I would like to have :

I select all the objects of the same style: I change the name of the style (and its colour).
I select an object (or a surface): I change the colour - or I create a new style if I change the name.

So a script for object styles with the same behavior as for object names.

Iwan

EDITED: 16 Nov 2021 by OZX

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10510.12 In reply to 10510.11 
Hi Iwan,

re:
> I select all the objects of the same style: I change the name of the style (and its colour).
> I select an object (or a surface): I change the colour - or I create a new style if I change the name.

What should happen if there is only one object assigned to a style? In that situation when the object is selected both of these cases will be true.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Iwan (OZX)
10510.13 In reply to 10510.12 
> What should happen if there is only one object assigned to a style? In that situation when the object is selected both of these cases will be true.

Yes. For the script on objects names, this is also the case.

Iwan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10510.14 In reply to 10510.13 
Hi Iwan, so it's a little more complex to set up a script for that behavior because it needs a customized dialog to do it. It's not just triggering the same behavior as a mouse click currently does like the other scripts.

But I'll see about setting it up for you.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Iwan (OZX)
10510.15 In reply to 10510.14 
Ok, I understand. Thank you very much.

Iwan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10510.16 In reply to 10510.15 
Hi Iwan, here's an attempt for an "edit or create" style shortcut.

Copy the attached file EditOrCreateStyleDialog.htm into the appdata commands folder.

On Windows you can find the Moi appdata folder by typing Win+R to bring up the Windows "Run" dialog and then type in:
%AppData%\Moi\commands

On Mac from a Finder window, go to the menu and pick Go > "Go to folder" and type in:
~/Library/Application Support/Moi/commands


Then set up a shortcut key for opening up the dialog and for the shortcut key put in:
script: /* Edit or create style */ var dlg = moi.ui.createDialog( 'moi://commands/EditOrCreateStyleDialog.htm' ); dlg.window.doModal();

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Iwan (OZX)
10510.17 In reply to 10510.16 
Hi Michael,
Thank you very much, I will give it a try.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Iwan (OZX)
10510.18 In reply to 10510.17 
Hi Michael, it works very well. I have one last request.

1) I select an object, I run the command and I put it in a "red" style.
2) I select another object, I run the command and I also put it in a "red" style.
Is it possible to put the second one in the same "red" style as the previous one?
And to update the colour if it is modified?

This is the case for the manipulation of object names.
With this script :
script: /* Edit object name */ var pp = moi.ui.propertiesPanel; if (pp.show && pp.numSelectedObjects > 0) { pp.editName(); }

1) I select an object (or surface), run the script and name it "01".
2) I select another object, I run the script and name it "01" too.
I do not have in the name hierarchy twice the name "01", but my two objects "01" are in the same place.

Thanks very much,

Iwan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10510.19 In reply to 10510.18 
Hi Iwan,

re:
> Is it possible to put the second one in the same "red" style as the previous one?
> And to update the colour if it is modified?

Please try with this updated version attached here.

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Iwan (OZX)
10510.20 In reply to 10510.19 
Hi Michael,


It works very well. It's great. It will make my work much faster. I often have a lot of materials (styles) to assign to my 3D.

Thank you very much,

Iwan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-10  11-20