Graphics.AddingANode - lordmundi/wikidoctest GitHub Wiki
Adding a Node
« Using the Tree Editor Tool | EDGE User’s Guide | Adding a model »
Simple directions
-
Edit userdata/configs/user_models.cfg
-
Add the node into the MODELS block inside the SCENE_LOAD block. For example:
node(example); xyz( 0.0, 10.0, 0.0 ); parent( EARTH_CENTER );
NOTE: A data node is the same as a model node except the "model( filename );" field is missing in the declaration.
NOTE: The information for a node (such as xyz, pyr, etc.) can be overwritten if a BASE_STATE is specified to be loaded at startup. If the node exists in the state file, the state file will have authority over the definition in the config file and might explain why editing the node in the config is not showing up in the scene.
Node selection dialog
What's really going on
The userdata/configs/user_models.cfg file should be getting included in the postload section of userdata/user.cfg. This file has a skeleton set up to allow the user to set up nodes, cameras, lights, and camera types.
In reality, this block structure could be put into any config file and postloaded, so if you want to add models, lights, or cameras specific to a plugin or gui script, you could make a seperate models file just for that plugin and postload it in it's own config file.
For example, if I was writing a plugin for the sun, i could make a single config file that includes the plugin, includes GUI elements to add menu options to control it, and include my own sun_models.cfg that would have all of the nodes that my plugin and GUI script needs. This way, to remove the plugin, I only need to comment out the inclusion of that one top-level config file.
The user_models.cfg is set up so users can generically add nodes, models, cameras, and lights easily.
The syntax for a node:
# node( node_name );
# model( file_name );
# xyz( x_val, y_val, z_val );
# pyr( pitch_val, yaw_val, roll_val );
# order( PYR/PRY/YPR/YRP/RPY/RYP );
# parent( node_name );
# layer( BACKGROUND/SCENE/FOREGROUND );
# priority( val );
# lod( SIZE/DISTANCE/SELECT/TIME, size/dist/obj_id/duration, file_name );
« Using the Tree Editor Tool | EDGE User’s Guide | Adding a model »