예제 #1
0
bpy::list dictionary_array_to_bpy_list(const DictionaryArray& array)
{
    bpy::list metadata;

    for (size_t i = 0, e = array.size(); i < e; ++i)
        metadata.append(dictionary_to_bpy_dict(array[i]));

    return metadata;
}
예제 #2
0
void FormatContext::findStreamInfo(DictionaryArray &streamsOptions, OptionalErrorCode ec)
{
    auto ptrs = streamsOptions.release();
    auto count = streamsOptions.size();

    ScopeOutAction onReturn([&ptrs, count, &streamsOptions](){
        streamsOptions.assign(ptrs, count);
    });

    findStreamInfo(ptrs, count, ec);
}
예제 #3
0
bpy::dict dictionary_array_to_bpy_dict(
    const DictionaryArray&  array,
    const char*             key)
{
    bpy::dict dictionaries;

    for (size_t i = 0, e = array.size(); i < e; ++i)
    {
        bpy::dict d(dictionary_to_bpy_dict(array[i]));
        dictionaries[d[key]] = d;
    }

    return dictionaries;
}
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);
    }
}