Named Objects design proposal

Next
 From:  RobertH
7108.1 
Hello, my name is Robert. I just purchased MoI last week and I must say it is terrific! I love the community here and how helpful everyone is... and Michael Gibson goes way above and beyond what anyone can reasonably expect from the developer of such a great product, with all the help, support and numerous scripts he has contributed... thanks Michael! And I really like your design philosophy of keeping things clean and simple in the UI and yet having the capability for letting the user extend the product through extensive modifications in both its capabilities and layout, while being extremely helpful in making that happen. Being able to customize a product engenders loyalty to that program.

Anyway it seems important in MoI for naming objects as a means of organizing a projects components. But the last thing I want to do while designing something is coming up with names for objects, it really breaks the flow, at least for me. So I started looking at the various object naming scripts on the forums. There are some really good ones, that would be useful in various scenarios, but I did not want a whole slew of shortcut keys trying to remember what each one does in a particular situation. So I started thinking about what I would like and how to organize them in a simple yet powerful unified design. Some of my criteria include the following:

1. It must be easy and fast to use. 2. Selecting a name from a pick list, that the user populated while being able to add to, delete from, rename and reorder that list, easily, while still working within MoI. 3. The name could be applied to the current selection of one or more objects, while still allowing additional objects to be selected, before the name was applied. 4. If more than one object was selected, those objects could either have the same name, or a unique name generated by means of an underscore followed by a numerically appended suffix, (this would "group" similar objects by name). 5. The selected objects could be assigned to an already existing object name, again selected from a pick list and optionally adding a unique underscore and number. 6. Existing named objects should be easily renamed.

I would also like to be able to select/name all objects that currently don't have a name, but maybe that should be accomplished by a script that would make that selection, before calling this design code.

Most of the code / scripts for the proposed system already exist with the exception of the unique naming/numbering system, but that is fairly trivial. And the list management functions exist in the Edit Styles dialogue (I don't know if this is a written as a script or a built in MoI module).
I think this would make a great addition to MoI, simple yet powerful. So here is a mockup of this design, along with notes on the various components. Could this be done in MoI?





This dialogue box could be called from the property box, and/or be assigned a shortcut key. It would remain open allowing the user to select or deselect additional objects, until a list item is double clicked, or the OK/Cancel buttons are clicked.

The dialogue elements:

1. Top Box. Remains blank if the selected object(s) is/are unnamed. Gets populated with the first selected named object. This would be an easy way for multiple objects to have the same name (like a group). Double clicking on this name, if it exists, would assign that name to all the selected objects and close the dialogue box. If the "Make Name Unique" (5) checkbox is also selected, unique names would be generated based on this boxes contents.

2. "Preset Name List" and "Current Object Names" list buttons. Two buttons that will display a list of object names in the item list (4). The first displays items from the user created Preset Names List, the second switches that list to all the named objects in the current MoI file, the same as the object list in the Scene Browser. (Reusable code).

3. Edit Button. This would work exactly the same as the Edit Styles Dialogue. The Preset Name List can be added to, deleted from, renamed and reordered just like Styles. Most of that code could be reused.

4. List Box. The list of Preset Names or a list of objects names from the current file. Double clicking on a name would assign it to the selected object(s) and close the dialogue box. If the "Make Name Unique" (5) checkbox is also selected, unique names would be generated based on the selected list item.

5. Make Name Unique checkbox. Having this checkbox checked would take whatever name the user selected and append an underscore and numbers to it to make it unique, if it is not already so. For example "Name_001", "Name_002", etc.

6. New Button. This would open up a dialogue box requesting a new name. It would also have a checkbox that would allow adding the newly entered name to the list of presets. It would assign the new name and close the dialogue box.

7. OK button. Just like a double click in box 1 or list 4 the highlighted name would be assigned to the selected objects, and the dialogue box would close.

8. Cancel Button. Closes the dialogue box and does nothing.

Again this dialogue box stays open to allow selection and/or deselection of additional objects, until double clicking in box(1), list(4) or on buttons (6,7 or 8) .


Options:

1. Add a "Select UnNamed Objects" button. If pressed all the unnamed Visible objects are selected, and can then be named. This could work very well with the "Make Name Unique" checkbox to name every object in a viewport. (Or this could be a separate script, executed before this dialogue box is called).

2. Two boxes could be displayed with running totals of the number of named and unnamed objects that are currently selected.

Thanks for taking the time to look over this proposed design. It should be easy to implement since most of the code already exists, and make a useful addition to MoI. Could this be done?
Image Attachments:
Size: 37.6 KB, Downloaded: 50 times, Dimensions: 575x548px
  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
7108.2 In reply to 7108.1 
Hi Robert welcome to MoI and to the forum!

I think it would be possible to implement much of what you're describing in MoI as a script, if you'd like to try to do the implementation some existing scripts that do part of that functionality are here:

AssignName - set the name of an object from a list of existing named objects:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3830.4

AssignPresetName - set the name of an object from a fixed preset list of names in a text file:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3830.8

Those ones are close to the functionality that you are asking about and so they would probably be your best bet as a starting spot for modifying it to get your desired design.

Probably a couple of the details of your proposed design would be difficult to implement currently with scripts though, especially the part about the dialog staying open and changing in response to changing selections. There is not really any mechanism set up for scripts to get notified when the selection changes.

Also unfortunately a lot of the things that deal with styles, like the Edit Styles dialog pretty much rely on internal helper functions to do stuff, so some of those things are not as easily reusable for other purposes as it sounds like you're expecting...

But anyway the AssignName and AssignPresetName plug-ins from the above links will get a major portion of what you're describing working for you right now.

In the future I want to make it easier to assign to existing names using some method in the scene browser itself...

- 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:  RobertH
7108.3 In reply to 7108.2 
Thanks for your reply Michael!

Can you point me to any scripts that are dialogue boxes like one of the ones you mentioned but have several tabs like the side panel. Can a dialogue script contain more than one control? And any scripts that have a checkbox whose value can be read by the script? Thanks!
  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:  RobertH
7108.4 
Michael, just as an aside, I was born in Holland but now live in San Diego... Mooi in dutch means beautiful.
  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
7108.5 In reply to 7108.3 
Hi Robert,

> Can you point me to any scripts that are dialogue boxes like one of the
> ones you mentioned but have several tabs like the side panel.

I'm not aware of any script that has those kind of tabs in it, but you can use the same tab control that the side pane uses. You'll find the side pane code inside the \ui sub-folder, in the file SidePane.htm. If you look in there you'll see some tab controls, like for example here is the one for the Draw curve / Draw solid tabs:

code:
	<moi:Tabcontainer>
		<moi:TabButton id="DrawCurveTab"><moi:Text textid="Draw curve tab"/></moi:TabButton>
		<moi:TabButton id="DrawSolidTab"><moi:Text textid="Draw solid tab"/></moi:TabButton>
	</moi:Tabcontainer>


The <moi:Tabcontainer> element has an activeTab property that can be referenced on it, and it fires an ontabchange event when the tab changes, if you put an ontabchange="" event handler on the tab container that will get called when the tab control changes and you will then want to look at the tab control's activeTab value and show or hide other stuff depending on that value.


> Can a dialogue script contain more than one control?

A dialog can have any number of controls on it.


> And any scripts that have a checkbox whose value can be read by the script? Thanks!

A checkbox control can be placed by using a <moi:CheckButton>button text label</moi:CheckButton> control. Give the control an id="" value like id="mycheckbox" and then the value of it can be read in script by retrieving the .value property, like mycheckbox.value .

- 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:  RobertH
7108.6 In reply to 7108.5 
Thanks so much! Really appreciate the help.
  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:  RobertH
7108.7 
Another question Michael, is there a visual editor for working on the dialogue boxes, or is it all text based and try in MoI?
  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:  Michael Gibson
7108.8 In reply to 7108.7 
Hi Robert, sorry no there is no visual editor it's all just edit in a text editor and test it with MoI.

It is helpful to set DisableFileCaching=y inside of moi.ini to make MoI reload files on every run rather than caching them in memory like it will do by default, see here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=6727.2

- 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
 

Reply to All Reply to All