Extensions:2.6/Py/Scripts/Import-Export/FuturePinball FPx

提供: wiki
移動先: 案内検索
Working
Right now a documenter is working on this part of the Manual. Please do not edit this article if you see this sign. Thank you.
Feel free to comment on the talk page however.
FuturePinball FPx
Import Future Pinball files
UI location File → Import-Export → Future Pinball ...
Usage to import:
  • File → Import → Future Pinball Model (.fpm)
  • File → Import → Future Pinball Library (.fpl)
  • File → Import → Future Pinball Table (.fpt)
Version 0.00.201401111 Author(s) Alexander Nussbaumer
Blender 2.68.0 License GPL
Category Import-Export Distribution Contrib
Note(s) this add-on is made for the community of GoPinball and all others. it based on an implementation of LvR from PinSimDB


Executable information
File name contained files:
  • io_scene_fpx
    • __init__.py
    • cfb_spec.py
    • fpx_import.py
    • fpx_resource.blend
    • fpx_spec.py
    • fpx_strings.py
    • fpx_ui.py
    • fpx_utils.py
    • lzo_spec.py
Current version download you can get the add-on
Python modules depends on addon_utils, io_scene_ms3d v0.99.1


Warning work in progress
Known Issues work in progress


History

(Click here, to see full history in SVN)
(Click here, to see full history in GIT)
(Click here, to see full tree in GIT)

WIP: WORK IN PROGRESS !!!
this add-on and this documentation may change drastically! this is only a snap shot of current state of development.
  • some table importer options on the panels do not have any effect.
  • the curves are currently not 100% accurate
  • dummy light bubbles are added for light emitting objects.


  • table importer creates/assigns textures of most table objects.
  • table importer can now load external fpl libraries and embedded fpm models.
  • is now shipped with an embedded library of the FuturePinball internal models.
  • table importer can now import needed libraries.
  • all sub-wires of a wire-ramp are supported
  • future pinball layers are converted to blender-layers
  • .fpm models can now imported directly
  • .fpl libraries can now imported directly


About

this add-on allows you to import Future Pinball model data from fpm, fpl and fpt files to Blender.

Example Video

(Click here if the video controls do not embed, for you.)
Example Example Render
(Click here if the video controls do not embed, for you.)
(Click here if the video controls do not embed, for you.)



Manual

Installation

Menu - User Preferences
Addons - Blender User Preferences
Install Addon...
  1. open add-on dialog tab
    to install and enable the add-on,
    go to "File → User Preferences → Addons", to open the "Addons"-tab of the "Blender User Preferences"-dialog.
  2. check if add-on is installed
    check, if the add-on is already included in your blender build
    to do that, enable ALL "Supported Level" on the left, to ensure, that all add-on will be respected to search results. ("Official", "Community", "Testing")
    than, type in "fpt" to the search box on the top left.
    if the list on the right is now empty, you can be sure, you don't have the add-on in your blender build.
    if you now see the "Future Pinball FPx format (.fpm/.fpl/.fpx)" add-on, you can skip the next step and can continue with step 4.
  3. installation
    now, as you can be sure, you don't have the add-on installed, you have to download and install the add-on.
    1. installation, from .ZIP file
      the easiest and preferred way is to download the add-on as single zip file
      http://wiki.blender.org/index.php/File:Addon-Fpx-File-io_scene_fpx.zip
      and in the bottom of the "Blender User Preferences", you have the "Install from File..."-button. click it and a new file select dialog will open. choose the "Addon-Fpx-File-io_scene_fpx.zip"-file your downloaded before and click on the upper right the "Install Addon...".
      (in windows7, blender puts the extracted files to "<C:\Users\...>\AppData\Roaming\Blender Foundation\Blender\2.67\scripts\addons")
    2. installation, from .PY files
      this is the hard, more ugly way i will show you not in detail.
      (in windows7), create a "<C:\Users\...>\AppData\Roaming\Blender Foundation\Blender\<2.67>\scripts\addons\io_scene_fpx\" folder and copy all files of the add-on to it by hand.
  4. enable/activate fpt add-on
    now you should see the "Future Pinball FPx format (.fpm/.fpl/.fpx)" add-on item in the list of the "Addons"-tab. to check the version of that add-on, you can enlarge the item to see the details, by clicking the tiny triangle on the left of the item. but the more important thing is to enable and activate the add-on. you have to check the check-box on the right upper side of that item.
  5. make add-on to default
    now the add-on should be installed and enabled. but if you close blender, at the next time the add-on is disabled again, as long as you does not save that state as blender default. to do that, click "Save as Default"-button on the bottom of the
    "Addons"-tab of the "Blender User Preferences"-dialog.



Dependencies of that Add-On
Please note, that the "Future Pinball FPx format (.fpm/.fpl/.fpx)" add-on depends on the "MilkShape 3D format (.ms3d)" add-on. so, when you see the Future Pinball import menu entry, but the entry is disabled, please check, that you also have the MilkShape 3D add-on enabled!



Import Future Pinball Model FPM-file

Import Options

Import Menu

there are some options available to tweak the import process a bit

Advanced Options

  • Verbose , this option shows the content of the fpm file to the "system console" during importing. all items and properties, that are parsed by the importer will be shown.
    note: that will very slow down the import process. on large models, the output buffer of the console should be big enough, otherwise you will only see the last parts of the output. you are be able to redirect the console output to a text file if you start blender with redirect standard output to text file - this can be handy to debug issues.

Import Options

  • Keep Temp Files , if enabled, all temporary files and folders will be kept. if disabled, all temporary files and folders will be deleted at the end of import process.
  • Import All Models Of Folder , if enabled, all fpm model files of the folder will imported. (needed only if you want to create a model library for the FPT-Table Importer)
  • Model To New Scene , if enabled, the imported model is placed in its own scene. (needed only if you want to create a model library for the FPT-Table Importer)
  • (Name Extra) , needed to create a named hierarchy, that the FPT-Table Importer expects. (keep it empty, if you just want to import a single model)

Model Data Options

  • Model Filter
    • Secondary Model , if enabled, secondary model data will be imported.
    • Reflection Model , if enabled, reflection model data will be imported.
    • Mask Model , if enabled, mask model data will be imported.
    • Collision Model , if enabled, collision model data will be imported.
  • Adjust Model Position , if enabled, imported model will be placed according its model type (Future Pinball place models in a different way than blender).
Adjust Model Position
Do not enable this option, if you import a model, that you want to export for later use in FuturePinball again



Import via Script

bpy.ops.import_scene.fpm(
        filepath, # e.g. "model.fpm"
        verbose='NONE',
        keep_temp=False,
        use_all_models_of_folder=False,
        use_scene_per_model=False,
        name_extra="",
        use_model_filter={'SECONDARY', 'REFLECTION', 'MASK', 'COLLISION'},
        use_model_adjustment=False,
        #filter_glob="*.fpm"
        )




Import Future Pinball Model FPL-file

Import Menu

there are some options available to tweak the import process a bit

Advanced Options

  • Verbose , this option shows the content of the fpl file to the "system console" during importing. all items and properties, that are parsed by the importer will be shown.
    note: that will very slow down the import process. on large models, the output buffer of the console should be big enough, otherwise you will only see the last parts of the output. you are be able to redirect the console output to a text file if you start blender with redirect standard output to text file - this can be handy to debug issues.

Import Options

  • Keep Temp Files , if enabled, all temporary files and folders will be kept. if disabled, all temporary files and folders will be deleted at the end of import process.
  • Import All Libraries Of Folder , if enabled, all fpl library files of the folder will imported. (helpful only, if you want to create a model library for the FPT-Table Importer)

Library Data Options

  • Library Filter , select, what resources of the libraries you want to import.
    • Model , if enabled, model data will be imported.
    • Graphic , if enabled, graphic (image/texture) data will be imported.
    • Dmd Font , if enabled, dmd font data will be imported.
    • Sound, if enabled, sound data will be imported.
    • Music , if enabled, music data will be imported.
    • Script , if enabled, script data will be imported.

Model Data Options

  • Model Filter
    • Secondary Model , if enabled, secondary model data will be imported.
    • Reflection Model , if enabled, reflection model data will be imported.
    • Mask Model , if enabled, mask model data will be imported.
    • Collision Model , if enabled, collision model data will be imported.
  • Adjust Model Position , if enabled, imported model will be placed according its model type (Future Pinball place models in a different way than blender).
Adjust Model Position
Do not enable this option, if you import a model, that you want to export for later use in FuturePinball again



Import via Script

bpy.ops.import_scene.fpl(
        filepath, # e.g. "library.fpl"
        verbose='NONE',
        keep_temp=False,
        use_all_libraries_of_folder=False,
        use_library_filter={'MODEL', 'GRAPHIC', 'DMDFONT', 'SOUND', 'MUSIC', 'SCRIPT'},
        use_model_filter={'SECONDARY', 'REFLECTION', 'MASK', 'COLLISION'},
        use_model_adjustment=False,
        #filter_glob="*.fpl"
        )



Import Future Pinball Table FPT-file

Import Options

Import Menu

there are some options available to tweak the import process a bit

Advanced Options

  • Verbose , this option shows the content of the fpt file to the "system console" during importing. all items and properties, that are parsed by the importer will be shown.
    note: that will very slow down the import process. on large models, the output buffer of the console should be big enough, otherwise you will only see the last parts of the output. you are be able to redirect the console output to a text file if you start blender with redirect standard output to text file - this can be handy to debug issues.

Import Options

  • Keep Temp Files , if enabled, all temporary files and folders will be kept. if disabled, all temporary files and folders will be deleted at the end of import process.
  • External Data Options
    • Libraries , resource path of Future Pinball Libraries.
    • DmdFonts , resource path of Future Pinball DmdFonts.
    • Tables , resource path of Future Pinball Tables.

Additional Options

  • Convert To Mesh , if enabled, all models will be converted to mesh objects.
  • Resolution Wire Bevel , sets the bevel resolution of the wires (curves).
  • Resolution Wire , sets the resolution of the wires (curves).
  • Resolution Rubber Bevel , sets the bevel resolution of the rubbers (curves).
  • Resolution Rubber , sets the resolution of the rubbers (curves).
  • Resolution Shape , sets the resolution of the other shapeable objects (curves).
  • Use Hermite Handle , adjusts the curve point handles according the Hermite algorithm - it is not fully implemented and has some issues. (Future Pinball is using the Hermite curve algorithm)
Use Hermite Handle
If you see some distortions of wires or surfaces, you can toggle that option, to try to get better results



Library Data Options

  • Library Filter , select, what resources of the libraries you want to import.
    • Model , if enabled, model data will be imported.
    • Graphic , if enabled, graphic (image/texture) data will be imported.
    • Dmd Font , if enabled, dmd font data will be imported.
    • Sound, if enabled, sound data will be imported.
    • Music , if enabled, music data will be imported.
    • Script , if enabled, script data will be imported.

Model Data Options

  • Model Filter
    • Secondary Model , if enabled, secondary model data will be imported.
    • Reflection Model , if enabled, reflection model data will be imported.
    • Mask Model , if enabled, mask model data will be imported.
    • Collision Model , if enabled, collision model data will be imported.
  • Adjust Model Position , if enabled, imported model will be placed according its model type (Future Pinball place models in a different way than blender).
Adjust Model Position
Do not enable this option, if you import a model, that you want to export for later use in FuturePinball again


Import via Script

bpy.ops.import_scene.fpt(
        filepath, # e.g. "table.fpt"
        verbose='NONE',
        keep_temp=False,
        path_libraries="C:\\Games\\Future Pinball\\Libraries",
        path_dmdfonts="C:\\Games\\Future Pinball\\DmdFonts",
        path_tables="C:\\Games\\Future Pinball\\Tables",
        convert_to_mesh=False,
        resolution_wire_bevel=8,
        resolution_wire=8,
        resolution_rubber_bevel=8,
        resolution_rubber=8,
        resolution_shape=8,
        use_hermite_handle=True,
        use_library_filter={'MODEL', 'GRAPHIC', 'DMDFONT', 'SOUND', 'MUSIC', 'SCRIPT'},
        use_model_filter={'SECONDARY', 'REFLECTION', 'MASK', 'COLLISION'},
        use_model_adjustment=False,
        #filter_glob="*.fpt"
        )



User Interface

Layers Table

FuturePinball to blender Layer

the imported objects of the table will be placed in different layer.

  • layers, left block, top row:
    • all imported objects
    • only visible objects
    • only invisible objects (non-rendered and/or full transparent)
    • only curve objects (e.g.: walls, wires)
    • only mesh objects (e.g.: toys, flippers, pegs)
  • layers, left block, bottom row:
    • only light emitting objects
    • only rubber objects
    • only chrome objects (wires and/or with sphere_mapping)
    • only crystal and transparent objects
    • ...

  • layers, right block, top row:
    • represents future pinball layer 2
    • represents future pinball layer 4
    • represents future pinball layer 6
    • represents future pinball layer 8
    • represents future pinball layer 0
  • layers, right block, bottom row:
    • represents future pinball layer 1
    • represents future pinball layer 3
    • represents future pinball layer 7
    • represents future pinball layer 5
    • represents future pinball layer 9




Layers Model

the imported model will be placed in different layer.

  • layers, left block, top row:
    • primary model
    • secondary model
    • reflection model
    • mask model
    • collision model




Implemented Features

Importer

  • done
      read data (Compound File Binary File Format)
  • done
      read data (Lempel-Ziv-Oberhumer lossless data compression algorithm)
  • done
      read data (Future Pinball File Format)
  • done
      read data (Future Pinball Model Format)
  • done
      read data (Future Pinball Table Format)
  • done
      read data (Future Pinball Library Format)
  • done
      grab data to disk (Future Pinball Model Format)
  • done
      grab data to disk (Future Pinball Library Format)
  • in progress Inprogress100.jpg 95%
      grab data to disk (Future Pinball Table Format)
  • done
      import Future Pinball Models
  • in progress Inprogress75.jpg 75%
      import Future Pinball Tables
  • TODOs (in random order):
    • [nice to have]: hooks to curve points, to edit curves easily.
    • [must have]: convert everything to mesh objects (2013-09-01)
    • [must have]: local & cookie-cut texture coordinate to mesh objects (2013-08-23)
    • [nice to have]: import image lists as blender texture image sequence
    • [nice to have]: import collision object model
    • [nice to have]: get rid of adjustments of model positions in fpm- & fpl-importer. fpt-importer should be able to place the models according their model types and usage.
    • [nice to have]: improve ramp-end-point handling




--Beta-tester