Cs Preview Window
From Blender2crystal
Contents |
[edit] Introduction
NOTE: this is atm an experimental feature, and thus highly buggy and missing a lot of major features. Will make your blender crash, and possibly show artifacts. Use at your own risk.
Blender2crystal can use crystalspace to render inside blender and thus use blender as a crystalspace world viewer.
[edit] Features
Current features include:
- Show full scenes.
- Object movement synced in real time.
- Material shadervars synced in real time.
- Many particles properties synced.
- Control of the cs virtual clock and sequence manager.
- Run animations on genmesh skeletons.
- Features embedded celstart capable of running celstart worlds inside blender.
[edit] Dependencies
The cs preview has pretty harsh dependencies, namely:
[edit] Bleeding edge software
Get svn version of blender, crystalspace, cel and b2cs
- https://svn.blender.org/svnroot/bf-blender/trunk/blender
- https://crystal.svn.sourceforge.net/svnroot/crystal/CS/trunk
- https://cel.svn.sourceforge.net/svnroot/cel/cel/trunk
- http://leapingcat.org/blender2crystal/index.php/Download
If you are using CS1.9, check this ticket: https://leapingcat.org/dev/ticket/54
[edit] Python support in cs and cel
You need to make sure you build the python modules successfully. Check http://www.crystalspace3d.org/main/PyCrystal for more info.
[edit] Cs properties module
You must get http://leapingcat.org/blender2crystal/csproperties.py and place it somewhere in your pythonpath (like python/site-packages/).
[edit] Pythonpath
You have to make sure you have all the following in your pythonpath:
- cspace module.
- blcelc module.
- csproperties.
example:
export PYTHONPATH=$CRYSTAL/out/linuxx86/optimize/bindings/python/:$CEL/out/linuxx86/optimize/bindings/python/:$CEL/scripts/
one nice test is to write the following in your python interpreter:
import cspace import blcelc import csproperties import pycel
[edit] Checking
First you can check if you have the b2cs3d icon in the b2cs interface (
). If so, all is good and you can skip this section.
If not you should check blender command line output when opening b2cs, you are expected to see something like the following (comments with # of why things could fail):
Check for b2cs3d dependencies: * embedgl True # this should never fail * cspace True # if this fails means you dont have cs bindings in pythonpath * pycscegui False # not needed * newbinds True # if this fails menas you dont have csproperties correctly installed. * verse False # not important * found blcelc module # if this fails means you dont have cel bindings in pythonpath (...) Using following experimental extensions: * b2cs3d
[edit] Usage
If the b2cs3d view loads, you should see a new icon in the top b2cs icons group:
.
[edit] Current state
Currently the view is most useful for preview a world from different angles, navigate it and tweak lighting and material properties. Also particles are somehow nice to work with.
The world property "visible layers" can be used to export only objects in the visible layers and thus preview only a part of the scene.
The logic sandbox (embedded celstart) is working, and celstart games can be played from within the 3d window. Also quests and python property classes can be reloaded, and there is a real time property view for property classes.
[edit] Important known bugs and annoyances
- 3D window must be in perspective mode or cs camera wont be synced properly.
- After running a celstart world, then opening another blend file, its not possible to run the new world, blender has to be restarted :P.
[edit] Loading the world
Basic way of using the view is by hitting ctrl+V, to export a world and load it in the cs preview window. The view is overlayed on top of the blender view, and you can operate it in the same way.
There is also a "run logic" button in the overlay interface to export and run a celstart app inside blender.
[edit] Blender 3d view
[edit] Controls
Once the world loads you should see a number of options:
toggles:
- draw: draw cs over this blender view.
- sequencer active: Start/stop the cs sequencer. Handy to stop cs sequences completely.
- virtual clock: Start/stop the cs clock. Handy to stop cs completely (other than rendering).
- drawentities: Draws a translucid sphere around entities.
- drawtriggers: Draws a visible representation of cel triggers (those set from b2cs).
- drawlights: Draws a visible representation of lights.
buttons:
- run logic: (only if celexport is set) Start in logic mode. Exports and runs a celstart world and runs it inside b2cs embedded celstart. Note you can't play from the blender 3d view, for that you have to go to the scripts window interface.
- animations: (only when animated genmesh or animesh is selected). Run an animation for the selected object.
- camera: (only when running logic) Toggle between different cameras in the world (normally only world -blender-, or cel camera).
[edit] Syncinc properties
There are several parameters which are updated in real time from blender (like positions, light controls, material shadervars, some properties, ambient, renderloop), but for the rest you will have to reload (Ctrl+v). Plan is to make as much as possible update in real time, and allow to load other things under request (like mesh changes), but still a lot is missing.
[edit] Scripts window interface
[edit] Celstart View
Here you can play loaded celstart games that you loaded with "run logic".
There are a number of controls:
- Compile: Doesnt do anything at the moment.
- Reload: Reload last map
- Reload pc: Reload a python property class (will swap all instanced pc's of that types with the new ones).
- Reload quest: Reload a quest (will swap all instanced quests of selected type with new ones).
[edit] Stats View
User can select an entity and a property class, and all real time relevant information for that property class will be displayed (basically properties, but also contained entities for pcinventory, and all internal variables in case of python property classes.
[edit] BugPlug
An arbitrary list of controls providing access to some of the functionality of crystalspace's bugplug (like see bounding boxes, collider meshes...).
Note normally input works by actually writing on the cs view, when needed (like selecting by regexp). This is because of how bugplug works at the moment
[edit] PostProcess
This is a primitive interface to select postprocessing chain, and tweak effect parameters.
[edit] Goals
The goals are to reach the following:
- Preview with most stuff synced in real time or updatable incrementally.
- Full logic sandbox, capable of playing the game, and tweaking it to a certain extent, while watching it from different cameras. (basically ready)
- Physics sandbox, capable of playing and stopping physics, and update as many parameters as possible. (done to a certain degree)
- Selection and navigation working nicely from cs window.
- Drawing of helpers to help understand the scene.

