I've implemented a system where a SceneObject can add a 'resource' property to the list of editable properties. What this will do is provide a text field as well as a '...' button next to it inside of the PropertyGrid. When the user clicks on the ..., a browser window is opened (all handled through the editor) for the appropriate type of resource. This browser window can then be used to preview and select a new resource that should be linked in. Of course, these browser windows can only handle specific types such as a material or a sound, so they will be able to be plugged in to the editor. When a resource is going to be changed, an appropriate browser is looked up and presented to the user.
So far, I have implemented a browser for Materials which will most likely also work with other types of resources that are built in to Ogre but I have to provide a ResourceFactory for those. It simply defines a type and the ability to query for the name and a preview SceneObject of it.
No comments:
Post a Comment