Jump to content
  • entries
    945
  • comments
    5,899
  • views
    930,067

Making a scene


Josh

1,789 views

 Share

The scene browser lets you see every entity and brush in the scene, and also lets you arrange entities in a hierarchy. You can add a light to the scene, position it onto a lamppost, then use the scene browser to parent the light to the lamppost model and save the whole thing as a prefab.

 

There's no "mesh" class in the new engine, and entities inherit a lot of the properties that models in LE2 had, like scripts and physics. Models are just MDL files, and generally just contain model and bone entities. A prefab, on the other hand, can contains models loaded from other files, lights, particle emitters, and anything else you can create in the engine. Whereas in Leadwerks Engine 2 you would use a script to create special entities in code and parent them to a model, in the new engine you can place and parent them visually, then save them as a prefab to be used again and again.

 

Top-level models can be dragged around in the hierarchy, but limbs (children contained within a model file) are a bit more problematic. If we allowed the user to create a character, then parent the character's arm to another model in the scene, then delete the character, leaving the arm...you can see how that could cause a lot of issues. What I'm leaning towards is a rule that it's fine to parent the top-level model to something else, and you can add entities within the model's sub-hierarchy, but changing the parent of a model's limb is not allowed. I hope this doesn't confuse people using it, but it makes sense; if you really need to alter an model file's hierarchy, it should be done in the model editor (similar to the texture and material editors you have seen).

 

You can still set different properties like color, script settings, etc. for limbs of different instances of the same model. The map file will just store data that says "attach these scripts to limb number 7 of this model after you load it". This way models will always be reloaded from their original files, and if you alter your model the whole map will be updated. Actually, the more I think about it, the more this makes sense...this is a map editor, not a modeling program.

 

Not shown here, but I am adding a filter at the bottom so you can type in a name and a list will appear of all objects in the scene that contain that name, so you can type in "tree" and find all relevant objects. Hmmmm, come to think of it, maybe I should also add a drop-down box to search by either object name or the name of the file the object was loaded from.

 

The check marks will toggle visibility recursively, though they don't work yet. I'm writing the grid and object selection rendering into the engine, so they'll be some commands like Entity::SetSelectionState(bool mode). I found this easier than a bunch of rendering callbacks, especially when the engine is designed to run multiple renderers. This might come in handy if you are writing any kind of editor.

 

blogentry-1-0-84418700-1313206502_thumb.jpg

 Share

3 Comments


Recommended Comments

I like the idea for the filter. Blender has something similar for tools but not for objects. Blender has a outliner which can get cluttered with objects. I think it would be a good idea to include a search filter like blender for tools. With blender you have hot keys and the gui can get a little confusing, but if you forget where something is all you have to do is hit space bar and search for it, and presto.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...