43 "Import each FBX material as a unique Blender material"},
48 "If a material with the same name already exists, reference that instead of importing"},
49 {0,
nullptr, 0,
nullptr,
nullptr},
58 "Vertex colors in the file are in sRGB color space"},
63 "Vertex colors in the file are in linear color space"},
64 {0,
nullptr, 0,
nullptr,
nullptr}};
70 params.use_custom_normals =
RNA_boolean_get(op->ptr,
"use_custom_normals");
72 params.props_enum_as_string =
RNA_boolean_get(op->ptr,
"use_custom_props_enum_as_string");
73 params.ignore_leaf_bones =
RNA_boolean_get(op->ptr,
"ignore_leaf_bones");
74 params.import_subdivision =
RNA_boolean_get(op->ptr,
"import_subdivision");
82 params.reports = op->reports;
86 if (paths.is_empty()) {
90 for (
const auto &path : paths) {
91 STRNCPY(params.filepath, path.c_str());
111 layout.use_property_split_set(
true);
112 layout.use_property_decorate_set(
false);
117 col.prop(ptr,
"use_custom_props",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
120 subcol.prop(ptr,
"use_custom_props_enum_as_string",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
126 col.prop(ptr,
"import_subdivision",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
127 col.prop(ptr,
"import_colors",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
128 col.prop(ptr,
"validate_meshes",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
133 col.
prop(ptr,
"mtl_name_collision_mode",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
139 panel.header->prop(ptr,
"use_anim",
UI_ITEM_NONE,
"", ICON_NONE);
140 panel.header->label(
IFACE_(
"Animation"), ICON_NONE);
155 ui_fbx_import_settings(
C, *op->layout, op->ptr);
162 ot->
name =
"Import FBX";
163 ot->description =
"Import FBX file into current scene";
164 ot->idname =
"WM_OT_fbx_import";
167 ot->exec = wm_fbx_import_exec;
169 ot->check = wm_fbx_import_check;
170 ot->ui = wm_fbx_import_draw;
182 RNA_def_float(ot->srna,
"global_scale", 1.0f, 1e-6f, 1e6f,
"Scale",
"", 0.001f, 1000.0f);
186 "mtl_name_collision_mode",
187 rna_enum_fbx_mtl_name_collision_mode_items,
189 "Material Name Collision",
190 "Behavior when the name of an imported material conflicts with an existing material");
193 fbx_vertex_colors_mode,
196 "Import vertex color attributes");
199 "use_custom_normals",
202 "Import custom normals, if available (otherwise Blender will compute them)");
207 "Import user properties as custom properties");
209 "use_custom_props_enum_as_string",
212 "Store custom property enumeration values as strings");
214 "import_subdivision",
217 "Import FBX subdivision information as subdivision surface modifiers");
222 "Ignore the last bone at the end of each chain (used to mark the length of the "
229 "Ensure the data is valid "
230 "(when disabled, data may be imported which causes crashes displaying or editing)");
232 RNA_def_boolean(ot->srna,
"use_anim",
true,
"Import Animation",
"Import FBX animation");
239 "Offset to apply to animation timestamps, in frames",
245 prop =
RNA_def_string(ot->srna,
"filter_glob",
"*.fbx", 0,
"Extension Filter",
"");
252 auto fh = std::make_unique<bke::FileHandlerType>();
#define STRNCPY_UTF8(dst, src)
void file_handler_add(std::unique_ptr< FileHandlerType > file_handler)
bool poll_file_object_drop(const bContext *C, bke::FileHandlerType *)
void fbx_file_handler_add()
Vector< std::string > paths_from_operator_properties(PointerRNA *ptr)
wmOperatorStatus filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *)
char * STRNCPY(char(&dst)[N], const char *src)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void WM_OT_fbx_import(wmOperatorType *ot)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
void ED_outliner_select_sync_from_object_tag(bContext *C)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void FBX_import(bContext *C, const FBXImportParams ¶ms)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
bool WM_operator_winactive(bContext *C)
Scene * CTX_data_scene(const bContext *C)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
float RNA_float_get(PointerRNA *ptr, const char *name)
void use_property_split_set(bool is_sep)
PanelLayout panel(const bContext *C, StringRef idname, bool default_closed)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
void active_set(bool active)
Layout & column(bool align)