void EntityEditorFormFactoryBase::add_render_layer_input_metadata( const Dictionary& values, InputMetadataCollection& metadata) const { const string render_layer = get_value(values, "render_layer", ""); metadata.push_back( Dictionary() .insert("name", "render_layer") .insert("label", "Render Layer") .insert("type", "text") .insert("use", "optional") .insert("default", render_layer)); }
void EntityEditorFormFactoryBase::add_name_input_metadata( const Dictionary& input_values, InputMetadataCollection& metadata) const { const string name = get_value(input_values, NameParameter, m_entity_name); metadata.push_back( Dictionary() .insert("name", NameParameter) .insert("label", "Name") .insert("type", "text") .insert("use", "required") .insert("value", name) .insert("focus", "true")); }
void EntityEditorFormFactoryBase::add_input_metadata( const DictionaryArray& widgets, const Dictionary& values, InputMetadataCollection& metadata) const { for (size_t i = 0; i < widgets.size(); ++i) { Dictionary widget = widgets[i]; const string widget_name = widget.get<string>("name"); if (values.strings().exist(widget_name)) widget.insert("default", values.get<string>(widget_name)); metadata.push_back(widget); } }
void EntityEditorFormFactoryBase::add_input_metadata( const DictionaryArray& input_metadata, const Dictionary& input_values, InputMetadataCollection& metadata) const { for (size_t i = 0; i < input_metadata.size(); ++i) { Dictionary im = input_metadata[i]; const string input_name = im.get<string>("name"); im.insert("value", input_values.strings().exist(input_name) ? input_values.get<string>(input_name) : im.strings().exist("default") ? im.get<string>("default") : ""); metadata.push_back(im); } }