Cleanup: Silence warnings from 1254fee589
Introduced in 1254fee589
Also remove translation from CLOG statements.
Pull Request: https://projects.blender.org/blender/blender/pulls/116836
This commit is contained in:
parent
75c71b78ba
commit
5b104fb3fa
|
@ -1,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Basic FileHandler for Operator that imports just one file
|
Basic FileHandler for Operator that imports just one file
|
||||||
-----------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
When creating a ``Operator`` that imports files, you may want to
|
When creating a ``Operator`` that imports files, you may want to
|
||||||
add them 'drag-and-drop' support, File Handlers helps to define
|
add them 'drag-and-drop' support, File Handlers helps to define
|
||||||
|
@ -14,6 +14,7 @@ required a set of properties, when the ``Operator`` can import just one
|
||||||
file per execution it needs to define the following property:
|
file per execution it needs to define the following property:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
filepath: bpy.props.StringProperty(subtype='FILE_PATH')
|
filepath: bpy.props.StringProperty(subtype='FILE_PATH')
|
||||||
|
|
||||||
This ``filepath`` property now will be used by the ``FileHandler`` to
|
This ``filepath`` property now will be used by the ``FileHandler`` to
|
||||||
|
@ -55,7 +56,7 @@ class CurveTextImport(bpy.types.Operator):
|
||||||
By default the file handler invokes the operator with the filepath property set.
|
By default the file handler invokes the operator with the filepath property set.
|
||||||
In this example if this property is set the operator is executed, if not the
|
In this example if this property is set the operator is executed, if not the
|
||||||
file select window is invoked.
|
file select window is invoked.
|
||||||
This depends on setting 'options={'SKIP_SAVE'}' to the property options to avoid
|
This depends on setting ``options={'SKIP_SAVE'}`` to the property options to avoid
|
||||||
to reuse filepath data between operator calls.
|
to reuse filepath data between operator calls.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
"""
|
"""
|
||||||
Basic FileHandler for Operator that imports multiple files
|
Basic FileHandler for Operator that imports multiple files
|
||||||
-----------------
|
----------------------------------------------------------
|
||||||
|
|
||||||
Also operators can be invoked with multiple files from 'drag-and-drop',
|
Also operators can be invoked with multiple files from 'drag-and-drop',
|
||||||
but for this it is require to define the following properties:
|
but for this it is require to define the following properties:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
directory: StringProperty(subtype='FILE_PATH')
|
directory: StringProperty(subtype='FILE_PATH')
|
||||||
files: CollectionProperty(type=bpy.types.OperatorFileListElement)
|
files: CollectionProperty(type=bpy.types.OperatorFileListElement)
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ class ShaderScriptImport(bpy.types.Operator):
|
||||||
By default the file handler invokes the operator with the directory and files properties set.
|
By default the file handler invokes the operator with the directory and files properties set.
|
||||||
In this example if this properties are set the operator is executed, if not the
|
In this example if this properties are set the operator is executed, if not the
|
||||||
file select window is invoked.
|
file select window is invoked.
|
||||||
This depends on setting 'options={'SKIP_SAVE'}' to the properties options to avoid
|
This depends on setting ``options={'SKIP_SAVE'}`` to the properties options to avoid
|
||||||
to reuse filepath data between operator calls.
|
to reuse filepath data between operator calls.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ static PointerRNA file_handler_import_operator_create_ptr(
|
||||||
const char *message =
|
const char *message =
|
||||||
"Expected operator properties filepath or files and directory not found. Refer to "
|
"Expected operator properties filepath or files and directory not found. Refer to "
|
||||||
"FileHandler documentation for details.";
|
"FileHandler documentation for details.";
|
||||||
CLOG_WARN(&LOG, TIP_(message));
|
CLOG_WARN(&LOG, "%s", message);
|
||||||
}
|
}
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ void WM_OT_drop_import_file(wmOperatorType *ot)
|
||||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drop_import_file_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
|
static void drop_import_file_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
|
||||||
{
|
{
|
||||||
const auto paths = WM_drag_get_paths(drag);
|
const auto paths = WM_drag_get_paths(drag);
|
||||||
|
|
||||||
|
|
|
@ -819,7 +819,7 @@ PropertyRNA *RNA_struct_find_property_check(PointerRNA &props,
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
CLOG_WARN(&LOG,
|
CLOG_WARN(&LOG,
|
||||||
TIP_("'%s : %s()' expected, got '%s : %s()'"),
|
"'%s : %s()' expected, got '%s : %s()'",
|
||||||
name,
|
name,
|
||||||
rna_property_type_identifier(property_type_check),
|
rna_property_type_identifier(property_type_check),
|
||||||
name,
|
name,
|
||||||
|
@ -844,7 +844,7 @@ PropertyRNA *RNA_struct_find_collection_property_check(PointerRNA &props,
|
||||||
|
|
||||||
if (prop_type != PROP_COLLECTION) {
|
if (prop_type != PROP_COLLECTION) {
|
||||||
CLOG_WARN(&LOG,
|
CLOG_WARN(&LOG,
|
||||||
TIP_("'%s : %s(type = %s)' expected, got '%s : %s()'"),
|
"'%s : %s(type = %s)' expected, got '%s : %s()'",
|
||||||
name,
|
name,
|
||||||
rna_property_type_identifier(PROP_COLLECTION),
|
rna_property_type_identifier(PROP_COLLECTION),
|
||||||
RNA_struct_identifier(struct_type_check),
|
RNA_struct_identifier(struct_type_check),
|
||||||
|
@ -854,7 +854,7 @@ PropertyRNA *RNA_struct_find_collection_property_check(PointerRNA &props,
|
||||||
}
|
}
|
||||||
|
|
||||||
CLOG_WARN(&LOG,
|
CLOG_WARN(&LOG,
|
||||||
TIP_("'%s : %s(type = %s)' expected, got '%s : %s(type = %s)'."),
|
"'%s : %s(type = %s)' expected, got '%s : %s(type = %s)'.",
|
||||||
name,
|
name,
|
||||||
rna_property_type_identifier(PROP_COLLECTION),
|
rna_property_type_identifier(PROP_COLLECTION),
|
||||||
RNA_struct_identifier(struct_type_check),
|
RNA_struct_identifier(struct_type_check),
|
||||||
|
|
Loading…
Reference in New Issue