URCHN Arkipelago Difference between revisions of "Reference desk"

Difference between revisions of "Reference desk"

From URCHN Arkipelago
Line 26: Line 26:
 
[[File:refdesk_unlocked.png|thumbnail|left]]
 
[[File:refdesk_unlocked.png|thumbnail|left]]
  
1- Press Select Library and pick the library file to add to.
+
# Press Select Library and pick the library file to add to.
2- Press the unlock Icon in the Reference Desk Header
+
# Press the unlock Icon in the Reference Desk Header
3- Fill in the case sensitive Category for your asset.
+
# Fill in the case sensitive Category for your asset.
4- Fill in the case sensitive Name for your asset (how it will appear on the button). Make sure it is not taken
+
# Fill in the case sensitive Name for your asset (how it will appear on the button). Make sure it is not taken
5- To add groups to your asset hit the + sign under either instance or Link groups. note: Instance groups will appear in the 3D view, while link groups will be linked, but not instanced, and will only appear in the shift-A Add group instance menu.
+
# To add groups to your asset hit the + sign under either instance or Link groups. note: Instance groups will appear in the 3D view, while link groups will be linked, but not instanced, and will only appear in the shift-A Add group instance menu.
6- If there are scripts in your file to be used e.g. a rig UI, hit Add and and add them to Link Scripts.
+
# If there are scripts in your file to be used e.g. a rig UI, hit Add and and add them to Link Scripts.
7- If you have created a 'post install' script that needs to run once after the asset is linked, hit the plus sign and add it under Execute Scripts
+
# If you have created a 'post install' script that needs to run once after the asset is linked, hit the plus sign and add it under Execute Scripts
8- Press the Store New Asset button
+
# Press the Store New Asset button
9- When adding a new asset *make sure you change the Asset: name* or all hell will break loose :)
+
# When adding a new asset *make sure you change the Asset: name* or all hell will break loose :)
10- Make sure you commit the library.json file or nobody will see your changes.
+
# Make sure you commit the library.json file or nobody will see your changes.
 
<br style="clear: both" />
 
<br style="clear: both" />
  

Revision as of 12:49, 4 March 2013

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.py

Refdesk 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: There is now a button in the addon panel called "Select Library" that opens a file browser. In tube the library is called "library.json" and resides in the top level of the project SVN tree.

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

Refdesk.png


5- For people creating Assets, it is now possible to add directly the asset in the reference desk panel. See below.

Creating Assets

Refdesk unlocked.png
  1. Press Select Library and pick the library file to add to.
  2. Press the unlock Icon in the Reference Desk Header
  3. Fill in the case sensitive Category for your asset.
  4. Fill in the case sensitive Name for your asset (how it will appear on the button). Make sure it is not taken
  5. To add groups to your asset hit the + sign under either instance or Link groups. note: Instance groups will appear in the 3D view, while link groups will be linked, but not instanced, and will only appear in the shift-A Add group instance menu.
  6. If there are scripts in your file to be used e.g. a rig UI, hit Add and and add them to Link Scripts.
  7. If you have created a 'post install' script that needs to run once after the asset is linked, hit the plus sign and add it under Execute Scripts
  8. Press the Store New Asset button
  9. When adding a new asset *make sure you change the Asset: name* or all hell will break loose :)
  10. Make sure you commit the library.json file or nobody will see your changes.


Editing Assets

Not done yet! For now you'll need to edit the .json file directly

Deleting Assets

Not done yet! For now you'll need to edit the .json file directly

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"]]}}}