Unlimited hierarchies for components and scenes (2)
-
DEVICES
Devices can be made by anyone just like ruby plug-ins for Sketchup. There are few rules:
Add name as an option to an existing menu prompt - e.g. Nset > Edit - or create new menu prompt and option - e.g. Animation > Create
Code in Javascript and save the file using prompt + option - e.g. nsetEdit.js, animationCreate.js.
Incorporate the functions described below.
Use the config global variable but delete any members introduced for the device.
The required functions are:
This is called by the device initiator in the machine code to display the main list in the device prompt slider.
This is called from a common function on selection of a prompt.
This is called from a core function on selection of an option.
This is called from the machine to clean up config file.
See FILES for an explanation of the file structure.
DEVICES FOR TEST
Machine devices enable manipulation of names that belong to its owner, at this stage adding and deleting either private or sharable named links.
Nset devices are similar but for use within in a sharable nameset. Additional options include specifying a Type.
View devices now only include the ability to toggle visibility on and off.
Currently all new names are via user input but later a set of functions will use the Type and other key/value pairs to store unique input and offer pertinent lists from which to select.
FILES
nameset.rb is called from its launcher in the plug_in folder. It needs to be activated from Preferences > Extensions > Nameset. For this test it handles only the webdialog and callbacks for retrieving and saving text and swapping sharable nsets.
zExample_x.json are text files in JavaScript Object Notation holding nset data for projects. Only zExample_2 has been extended beyond the automaticaaly added NSET and VIEW nodes.
nset.json holds both the machine owners private links and the current sharable nset (in this case, zExample_2)
mset.json holds the machine owner's menu of selected device groups and devices.
config.json holds the nametrail (which determines the names' animation) and a few other essential variables.
viewEdit, nsetCreate and machineSetup are device files.
ruby.js handles the callbacks and scripts that retrieve and save data including swapping sharable nsets.
machine.js controls the display and devices.
json2.json was downloaded from http://www.JSON.org
core.js contains many common functions that are used by machine and devices
nameset.css and nameset.html are pretty standard except for this div that enables devices to be swapped
by this:
PLANNED
Mac compatibilty
Importing layer, component and scene names
Importing scene properties
Copying and other nset and view editing tools
Resizing and column options
Model/machine interaction
Nset record output
Unique word store
Shortcuts
Machine configuration and preferences
Standalone applicationIf you find this interesting please download and try out the plugin and post any comments in this topic. Please note the idea is to test building hierarchies in the interface - interaction with models has been removed in order to progress step by step.
Thanks
Thanks
Advertisement