URCHN Arkipelago Difference between revisions of "Reference desk"

Difference between revisions of "Reference desk"

From URCHN Arkipelago
Line 25: Line 25:
 
The library file uses JSON to point to the various items to be linked. An example is listed below. Note that JSON is a very easy format, indeed, it looks a lot like python lists/dictionary data structures, so shouldn't be too hard to figure out. Future enhancements could be adding a file browser for the library file (instead of adding a property) and an interface for editing the JSON.
 
The library file uses JSON to point to the various items to be linked. An example is listed below. Note that JSON is a very easy format, indeed, it looks a lot like python lists/dictionary data structures, so shouldn't be too hard to figure out. Future enhancements could be adding a file browser for the library file (instead of adding a property) and an interface for editing the JSON.
 
{{{
 
{{{
 +
 
{"Characters": {
 
{"Characters": {
 
     "Gilgamesh": {
 
     "Gilgamesh": {

Revision as of 08:51, 24 August 2011

Reference Desk is a Blender Addon developed for tube by Christopher Allan Webber, of Mediagoblin fame, and further tweaked by Bassam Kurdali.

Theory of operation

Reference Desk uses a JSON file 'library.json' to store a list of tasks per linked asset :

- groups to link and instance - groups to link only - scripts to link - scripts to run after linking all of the above.

It presents an interface in the Toolbox area of the 3D view (left side panels), with a search box and a set of buttons for each asset. For each button pressed, it will look up the asset in the JSON file, link in all items, and then run the post install script on them. This allows you to link e.g. the entire station by one button press.

Installation and Usage

1- install the addon: file->user preferences->addons tab->Install addon: $SVNROOT/lib/python/addons/reference_desk.pyRefdesk addon.png

2- enable the addon, and save your user preferences, you'll get a rather useless panel in your toolbar.Blank refdesk.png

3- In a scene file: In the properties > scene > custom properties add a property library, containing a string that is the path to the JSON file (usually: ../../library.json)Library property.png

4- the buttons will appear in the reference desk panel in the toolbar. Add library assets at will.Refdesk.png

JSON file format

The library file uses JSON to point to the various items to be linked. An example is listed below. Note that JSON is a very easy format, indeed, it looks a lot like python lists/dictionary data structures, so shouldn't be too hard to figure out. Future enhancements could be adding a file browser for the library file (instead of adding a property) and an interface for editing the JSON. {{{

{"Characters": {

   "Gilgamesh": {
       "instance_groups": [
           ["lib/models/chars/gilgamesh.blend", "gilga_HI"]],
       "noninstance_groups": [
           ["lib/models/chars/gilgamesh.blend", "gilga_PROX"]],
       "noninstance_groups": [
           ["lib/models/chars/gilgamesh.blend", "gilga_FACP"]],
       "require_python_texts": [
           ["lib/models/chars/gilgamesh.blend", "tuberigUI.py"]],
       "exec_python_posthooks": [
           ["lib/models/chars/gilgamesh.blend", "__gilgamesh_post.py"]]},
   "Gilga Roach Close": {
       "instance_groups": [
           ["lib/models/chars/gilga_roach.blend", "Roach_HI"]],
       "require_python_texts": [
           ["lib/models/chars/roach.blend", "tube_roach_rigui.py"]],
       "exec_python_posthooks": [
           ["lib/models/chars/gilga_roach.blend", "__groach_post.py"]]},
   "Enkidu Roach Close": {
       "instance_groups": [
           ["lib/models/chars/enkidu_roach.blend", "Roach_HI"]],
       "require_python_texts": [
           ["lib/models/chars/roach.blend", "tube_roach_rigui.py"]],
       "exec_python_posthooks": [
           ["lib/models/chars/enkidu_roach.blend", "__eroach_post.py"]]},
   "Roach Close": {
       "instance_groups": [
           ["lib/models/chars/roach.blend", "Roach_HI"]],
       "noninstance_groups": [
           ["lib/models/chars/roach.blend", "Roach_LO"]],
       "require_python_texts": [
           ["lib/models/chars/roach.blend", "tube_roach_rigui.py"]],
       "exec_python_posthooks": [
           ["lib/models/chars/roach.blend", "__roach_post.py"]]},
   "Roach Medium": {
       "instance_groups": [
           ["lib/models/chars/roach.blend", "Roach_MED_HI"]],
       "noninstance_groups": [
           ["lib/models/chars/roach.blend", "Roach_LO"]],
       "require_python_texts": [
           ["lib/models/chars/roach.blend", "tube_roach_rigUI.py"]],
       "exec_python_posthooks": [
           ["lib/models/chars/roach.blend", "__roach_post.py"]]},
   "Roach Far": {
       "instance_groups": [
           ["lib/models/chars/roach.blend", "Roach_FAR_HI"]],
       "noninstance_groups": [
           ["lib/models/chars/roach.blend", "Roach_LO"]],
       "require_python_texts": [
           ["lib/models/chars/roach.blend", "tube_roach_rigUI.py"]],
       "exec_python_posthooks": [
           ["lib/models/chars/roach.blend", "__roach_post.py"]]}},

"Sets": {

   "Full Station": {
       "instance_groups": [
           ["lib/models/sets/pedestal_details.blend", "pedestal_details_V"],
           ["lib/models/sets/station.blend", "station_HI"],
           ["lib/models/sets/ground.blend", "ground_HI"]],
       "noninstance_groups": [
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_1"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_2"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_3"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_gap"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_1"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_2"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_3"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_gap"],
           ["lib/models/sets/track_mid.blend", "track_mid_HI"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_box"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_box_line"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_concrete"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_tubes"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_wires_1"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_wires_2"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_wires_3"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_rail"],
           ["lib/models/sets/track_mid.blend", "track_mid_LO"],
           ["lib/models/sets/column.blend", "base_HI"],
           ["lib/models/sets/column.blend", "base_LO"],
           ["lib/models/sets/column.blend", "base2_HI"],
           ["lib/models/sets/column.blend", "base2_LO"],
           ["lib/models/sets/platform.blend", "platform_HI_1"],
           ["lib/models/sets/platform.blend", "platform_V_boxes"],
           ["lib/models/sets/platform.blend", "platform_V_escalator"],
           ["lib/models/sets/platform.blend", "platform_V_papers"],
           ["lib/models/sets/platform.blend", "platform_V_tubes"],
           ["lib/models/sets/platform.blend", "platform_V_wire"],
           ["lib/models/sets/platform.blend", "platform_HI_2"],
           ["lib/models/sets/platform.blend", "platform_LO"],
           ["lib/models/sets/station.blend", "station_LO"],
           ["lib/models/sets/ground.blend", "ground_LO"]],
       "exec_python_posthooks": [
           ["lib/models/sets/pedestal_messy.blend", "__pedestal_messy.py"],
           ["lib/models/sets/track_mid.blend", "__trackmid_post.py"],
           ["lib/models/sets/column.blend", "__column_post.py"],
           ["lib/models/sets/platform.blend", "__platform_post.py"]]},
   "Escalator": {
       "instance_groups": [
           ["lib/models/sets/escalator.blend", "escalator_HI"]],
       "noninstance_groups": [
           ["lib/models/sets/escalator.blend", "escalator_LO"]]},
   "Station": {
       "instance_groups": [
           ["lib/models/sets/station.blend", "station_HI"]],
       "noninstance_groups": [
           ["lib/models/sets/station.blend", "station_LO"]]},
   "Ground": {
       "instance_groups": [
           ["lib/models/sets/ground.blend", "ground_HI"]],
       "noninstance_groups": [
           ["lib/models/sets/ground.blend", "ground_LO"]]},
   "Platform sides": {
       "noninstance_groups": [
           ["lib/models/sets/column.blend", "base_HI"],
           ["lib/models/sets/column.blend", "base_LO"],
           ["lib/models/sets/column.blend", "base2_HI"],
           ["lib/models/sets/column.blend", "base2_LO"],
           ["lib/models/sets/platform.blend", "platform_HI_1"],
           ["lib/models/sets/platform.blend", "platform_V_boxes"],
           ["lib/models/sets/platform.blend", "platform_V_escalator"],
           ["lib/models/sets/platform.blend", "platform_V_papers"],
           ["lib/models/sets/platform.blend", "platform_V_tubes"],
           ["lib/models/sets/platform.blend", "platform_V_wire"],
           ["lib/models/sets/platform.blend", "platform_HI_2"],
           ["lib/models/sets/platform.blend", "platform_LO"]],
       "exec_python_posthooks": [
           ["lib/models/sets/column.blend", "__column_post.py"],
           ["lib/models/sets/platform.blend", "__platform_post.py"]]},
   "Station Rails": {
       "noninstance_groups": [
           ["lib/models/sets/track_mid.blend", "track_mid_HI"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_box"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_box_line"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_concrete"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_tubes"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_wires_1"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_wires_2"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_wires_3"],
           ["lib/models/sets/track_mid.blend", "track_mid_V_rail"],
           ["lib/models/sets/track_mid.blend", "track_mid_LO"]],
       "exec_python_posthooks": [
           ["lib/models/sets/track_mid.blend", "__trackmid_post.py"]]},
   "Messy Pedestals": {
       "instance_groups": [
           ["lib/models/sets/pedestal_details.blend", "pedestal_details_V"]],
       "noninstance_groups": [
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_1"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_2"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_3"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_HI_gap"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_1"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_2"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_3"],
           ["lib/models/sets/pedestal_messy.blend", "pedestal_messy_LO_gap"]],
       "exec_python_posthooks": [
           ["lib/models/sets/pedestal_messy.blend", "__pedestal_messy.py"]]}},

"Props": {

   "telephone": {
       "instance_groups": [
           ["lib/models/props/phone.blend", "telephone"]]},
   "gearbox": {
       "instance_groups": [
           ["lib/models/props/gearbox.blend", "gearbox"]]},
   "paper one hand": {
       "instance_groups": [
           ["lib/models/props/paper_hands_3.blend", "paper_inhand3"]],
       "require_python_texts": [
           ["lib/models/props/paper_hands_3.blend", "tube_pnh3_rigui.py"]],
       "exec_python_posthooks": [
           ["lib/models/props/paper_hands_3.blend", "__PNH_3_post.py"]]},
   "paper two hands": {
       "instance_groups": [
           ["lib/models/props/paper_hands_2.blend", "paperinhand_2_HI"]],
       "require_python_texts": [
           ["lib/models/props/paper_hands_2.blend", "tube_pnh2_rigui.py"]],
       "exec_python_posthooks": [
           ["lib/models/props/paper_hands_2.blend", "__PNH_2_post.py"]]},
   "gearbox_noninstance": {
       "noninstance_groups": [
           ["lib/models/props/gearbox.blend", "gearbox"]]},
   "gearbox_and_telephone": {
       "instance_groups": [
           ["lib/models/props/phone.blend", "telephone"],
           ["lib/models/props/gearbox.blend", "gearbox"]]}},

"Vehicles": {

   "Train Interior": {
       "instance_groups": [
           ["lib/models/vehicles/train_interior.blend", "train_int_HI"]],
       "noninstance_groups": [
           ["lib/models/vehicles/train_interior.blend", "train_int_LO"]]},
   "Train": {
       "noninstance_groups": [
           ["lib/models/vehicles/train.blend", "engine_HI"],
           ["lib/models/vehicles/train.blend", "engine_LO"],
           ["lib/models/vehicles/train.blend", "train_HI"],
           ["lib/models/vehicles/train.blend", "train_LO"],
           ["lib/models/vehicles/train.blend", "rearengine_HI"],
           ["lib/models/vehicles/train.blend", "rearengine_LO"]],
       "require_python_texts": [
           ["lib/models/vehicles/train.blend", "trainmaker.py"]],
      "exec_python_posthooks": [
           ["lib/models/vehicles/train.blend", "__train_post.py"]]}}}

}}}