Since version 0.2.32 there is a new file called
presets.js
which defines an
_DILDO_PRESETS
object. The object's members identify the preset sub menus
for the menu bar. Each member must have this structure:
{ label: "Sub menu name",
elements: [ <preset>, ... ]
}
where each <preset> item in the
elements
array must look like this:
{ name: "Preset name",
label: "Menu item name",
bezier_json: <bezier_string>,
bend_angle: <integer in 0..180>
}
If you wonder where to get the bezier string data from, just select the
Display Bezier String from the
Help menu.
The menu bar structure will automatically populated from your settings.
If you want to run the app on your local host or on your own website and you want to allow users
to publish their designs you first have to set up the publishing configuration.
First of all you need to enable the publish function in general. Go to the
config.js
file and set
_DILDO_CONFIG.HIDE_PUBLISH_MESH_MENU = false;
You also might want to change the publishing URL to the value of your choice:
_DILDO_CONFIG.PUBLISHING_URL = "store_custom_dildo.php";
Note that the URL may be absolute or relative. Whatever you require.
These two steps will make the Model→Publish menu appear and when clicked the publishing
dialog to pop up (to the user). After the user entered the required/optional data and pressed
the
'Publish!'
button, the configured URL will be called and the form data sent
to the server script via the HTTP POST request method.
Note that the screenshot data is passed as an application/x-www-form-urlencoded compatible base64 string, which means
that '/' is replaced by '_', and '+' is replaced by '-'.
If you are not sure what to do just take a look and the
store_custom_dildo.php
file.
Of course you may want to use any other server script language of your choice here (for those who
dislike PHP).
Don't forget to set up a database service. The
table_structure.sql
file might guide
you for the case you don't know how to start, assumed that you want to use a relational database system.