Example #1
0
void WM_OT_alembic_import(wmOperatorType *ot)
{
	ot->name = "Import Alembic";
	ot->description = "Load an Alembic archive";
	ot->idname = "WM_OT_alembic_import";

	ot->invoke = WM_operator_filesel;
	ot->exec = wm_alembic_import_exec;
	ot->poll = WM_operator_winactive;
	ot->ui = wm_alembic_import_draw;

	WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_ALEMBIC,
	                               FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH,
	                               FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);

	RNA_def_float(ot->srna, "scale", 1.0f, 0.0001f, 1000.0f, "Scale",
	              "Value by which to enlarge or shrink the objects with respect to the world's origin",
	              0.0001f, 1000.0f);

	RNA_def_boolean(ot->srna, "set_frame_range", true,
	                "Set Frame Range",
	                "If checked, update scene's start and end frame to match those of the Alembic archive");

	RNA_def_boolean(ot->srna, "validate_meshes", 0,
	                "Validate Meshes", "Check imported mesh objects for invalid data (slow)");

	RNA_def_boolean(ot->srna, "is_sequence", false, "Is Sequence",
	                "Set to true if the cache is split into separate files");

	RNA_def_boolean(ot->srna, "as_background_job", true, "Run as Background Job",
	                "Enable this to run the export in the background, disable to block Blender while exporting");
}
Example #2
0
void SCREEN_OT_screenshot(wmOperatorType *ot)
{
  /* weak: opname starting with 'save' makes filewindow give save-over */
  ot->name = "Save Screenshot";
  ot->idname = "SCREEN_OT_screenshot";
  ot->description = "Capture a picture of the active area or whole Blender window";

  ot->invoke = screenshot_invoke;
  ot->check = screenshot_check;
  ot->exec = screenshot_exec;
  ot->cancel = screenshot_cancel;
  ot->ui = screenshot_draw;
  ot->poll = screenshot_poll;

  ot->flag = 0;

  WM_operator_properties_filesel(ot,
                                 FILE_TYPE_FOLDER | FILE_TYPE_IMAGE,
                                 FILE_SPECIAL,
                                 FILE_SAVE,
                                 WM_FILESEL_FILEPATH,
                                 FILE_DEFAULTDISPLAY,
                                 FILE_SORT_ALPHA);
  RNA_def_boolean(ot->srna,
                  "full",
                  1,
                  "Full Screen",
                  "Capture the whole window (otherwise only capture the active area)");
}
Example #3
0
void WM_OT_collada_import(wmOperatorType *ot)
{
	ot->name = "Import COLLADA";
	ot->description = "Load a Collada file";
	ot->idname = "WM_OT_collada_import";
	
	ot->invoke = WM_operator_filesel;
	ot->exec = wm_collada_import_exec;
	ot->poll = WM_operator_winactive;
	
	WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
}
Example #4
0
/* second operator, only difference from BUTTONS_OT_file_browse is WM_FILESEL_DIRECTORY */
void BUTTONS_OT_directory_browse(wmOperatorType *ot)
{
	/* identifiers */
	ot->name= "Accept";
	ot->description="Open a directory browser, Hold Shift to open the file, Alt to browse containing directory";
	ot->idname= "BUTTONS_OT_directory_browse";

	/* api callbacks */
	ot->invoke= file_browse_invoke;
	ot->exec= file_browse_exec;
	ot->cancel= file_browse_cancel;

	/* properties */
	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
}
Example #5
0
void SCREEN_OT_screenshot(wmOperatorType *ot)
{
	ot->name= "Save Screenshot"; /* weak: opname starting with 'save' makes filewindow give save-over */
	ot->idname= "SCREEN_OT_screenshot";
	
	ot->invoke= screenshot_invoke;
	ot->exec= screenshot_exec;
	ot->poll= WM_operator_winactive;
	ot->cancel= screenshot_cancel;
	
	ot->flag= 0;
	
	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
}
Example #6
0
void FILE_OT_find_missing_files(wmOperatorType *ot)
{
	/* identifiers */
	ot->name= "Find Missing Files";
	ot->idname= "FILE_OT_find_missing_files";
	
	/* api callbacks */
	ot->exec= find_missing_files_exec;
	ot->invoke= find_missing_files_invoke;

	/* flags */
	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;

	/* properties */
	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
}
Example #7
0
void WM_OT_collada_import(wmOperatorType *ot)
{
	ot->name = "Import COLLADA";
	ot->description = "Load a Collada file";
	ot->idname = "WM_OT_collada_import";

	ot->invoke = WM_operator_filesel;
	ot->exec = wm_collada_import_exec;
	ot->poll = WM_operator_winactive;

	//ot->flag |= OPTYPE_PRESET;

	ot->ui = wm_collada_import_draw;

	WM_operator_properties_filesel(
	        ot, FILE_TYPE_FOLDER | FILE_TYPE_COLLADA, FILE_BLENDER, FILE_OPENFILE,
	        WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);

	RNA_def_boolean(ot->srna,
		"import_units", 0, "Import Units",
		"If disabled match import to Blender's current Unit settings, "
		"otherwise use the settings from the Imported scene");

	RNA_def_boolean(ot->srna,
		"fix_orientation", 0, "Fix Leaf Bones",
		"Fix Orientation of Leaf Bones (Collada does only support Joints)");

	RNA_def_boolean(ot->srna,
		"find_chains", 0, "Find Bone Chains",
		"Find best matching Bone Chains and ensure bones in chain are connected");

	RNA_def_boolean(ot->srna,
		"auto_connect", 0, "Auto Connect",
		"Set use_connect for parent bones which have exactly one child bone");

	RNA_def_int(ot->srna,
		"min_chain_length",
		0,
		0,
		INT_MAX,
		"Minimum Chain Length",
		"When searching Bone Chains disregard chains of length below this value",
		0,
		INT_MAX);

}
Example #8
0
void OBJECT_OT_multires_external_save(wmOperatorType *ot)
{
	ot->name= "Multires Save External";
	ot->description= "Save displacements to an external file";
	ot->idname= "OBJECT_OT_multires_external_save";

	// XXX modifier no longer in context after file browser .. ot->poll= multires_poll;
	ot->exec= multires_external_save_exec;
	ot->invoke= multires_external_save_invoke;
	ot->poll= multires_poll;
	
	/* flags */
	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;

	WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
	edit_modifier_properties(ot);
}
void RIGIDBODY_OT_world_export(wmOperatorType *ot)
{
	/* identifiers */
	ot->idname = "RIGIDBODY_OT_world_export";
	ot->name = "Export Rigid Body World";
	ot->description = "Export Rigid Body World\nExport Rigid Body world to simulator's own fileformat (i.e. '.bullet' for Bullet Physics)";

	/* callbacks */
	ot->invoke = rigidbody_world_export_invoke;
	ot->exec = rigidbody_world_export_exec;
	ot->poll = ED_rigidbody_world_active_poll;

	/* flags */
	ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;

	/* properties */
	WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
}
Example #10
0
void BUTTONS_OT_file_browse(wmOperatorType *ot)
{
	/* identifiers */
	ot->name = "Accept";
	ot->description = "Open a file browser, Hold Shift to open the file, Alt to browse containing directory";
	ot->idname = "BUTTONS_OT_file_browse";
	
	/* api callbacks */
	ot->invoke = file_browse_invoke;
	ot->exec = file_browse_exec;
	ot->cancel = file_browse_cancel;

	/* conditional undo based on button flag */
	ot->flag = 0;

	/* properties */
	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE,
	                               WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
}
Example #11
0
void CLIP_OT_open(wmOperatorType *ot)
{
	/* identifiers */
	ot->name = "Open Clip";
	ot->description = "Load a sequence of frames or a movie file";
	ot->idname = "CLIP_OT_open";

	/* api callbacks */
	ot->exec = open_exec;
	ot->invoke = open_invoke;
	ot->cancel = open_cancel;

	/* flags */
	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;

	/* properties */
	WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE,
	                               WM_FILESEL_RELPATH | WM_FILESEL_FILES | WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY);
}
Example #12
0
void FILE_OT_find_missing_files(wmOperatorType *ot)
{
	/* identifiers */
	ot->name = "Find Missing Files";
	ot->idname = "FILE_OT_find_missing_files";
	ot->description = "Try to find missing external files";
	
	/* api callbacks */
	ot->exec = find_missing_files_exec;
	ot->invoke = find_missing_files_invoke;

	/* flags */
	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;

	/* properties */
	RNA_def_boolean(ot->srna, "find_all", false, "Find All", "Find all files in the search path (not just missing)");

	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE,
	                               WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY);
}
Example #13
0
void WM_OT_collada_import(wmOperatorType *ot)
{
	ot->name = "Import COLLADA";
	ot->description = "Load a Collada file";
	ot->idname = "WM_OT_collada_import";

	ot->invoke = WM_operator_filesel;
	ot->exec = wm_collada_import_exec;
	ot->poll = WM_operator_winactive;

	//ot->flag |= OPTYPE_PRESET;

	ot->ui = wm_collada_import_draw;

	WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_OPENFILE,
	                               WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);

	RNA_def_boolean(ot->srna,
	                "import_units", 0, "Import Units",
	                "If disabled match import to Blender's current Unit settings, "
	                "otherwise use the settings from the Imported scene");

}
Example #14
0
void WM_OT_collada_export(wmOperatorType *ot)
{
    static EnumPropertyItem prop_bc_export_mesh_type[] = {
        {BC_MESH_TYPE_VIEW, "view", 0, "View", "Apply modifier's view settings"},
        {BC_MESH_TYPE_RENDER, "render", 0, "Render", "Apply modifier's render settings"},
        {0, NULL, 0, NULL, NULL}
    };

    static EnumPropertyItem prop_bc_export_transformation_type[] = {
        {BC_TRANSFORMATION_TYPE_MATRIX, "matrix", 0, "Matrix", "Use <matrix> to specify transformations"},
        {BC_TRANSFORMATION_TYPE_TRANSROTLOC, "transrotloc", 0, "TransRotLoc", "Use <translate>, <rotate>, <scale> to specify transformations"},
        {BC_TRANSFORMATION_TYPE_BOTH, "both", 0, "Both", "Use <matrix> AND <translate>, <rotate>, <scale> to specify transformations"},
        {0, NULL, 0, NULL, NULL}
    };

    ot->name = "Export COLLADA";
    ot->description = "Export COLLADA\nSave a Collada file";
    ot->idname = "WM_OT_collada_export";

    ot->invoke = wm_collada_export_invoke;
    ot->exec = wm_collada_export_exec;
    ot->poll = WM_operator_winactive;

    ot->flag |= OPTYPE_PRESET;

    ot->ui = wm_collada_export_draw;

    WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_COLLADA, FILE_BLENDER, FILE_SAVE,
                                   WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);

    RNA_def_boolean(ot->srna,
                    "apply_modifiers", 0, "Apply Modifiers",
                    "Apply modifiers to exported mesh (non destructive))");

    RNA_def_int(ot->srna, "export_mesh_type", 0, INT_MIN, INT_MAX,
                "Resolution", "Modifier resolution for export", INT_MIN, INT_MAX);

    RNA_def_enum(ot->srna, "export_mesh_type_selection", prop_bc_export_mesh_type, 0,
                 "Resolution", "Modifier resolution for export");

    RNA_def_boolean(ot->srna, "selected", 0, "Selection Only",
                    "Export only selected elements");

    RNA_def_boolean(ot->srna, "include_children", 0, "Include Children",
                    "Export all children of selected objects (even if not selected)");

    RNA_def_boolean(ot->srna, "include_armatures", 0, "Include Armatures",
                    "Export related armatures (even if not selected)");

    RNA_def_boolean(ot->srna, "include_shapekeys", 1, "Include Shape Keys",
                    "Export all Shape Keys from Mesh Objects");

    RNA_def_boolean(ot->srna, "deform_bones_only", 0, "Deform Bones only",
                    "Only export deforming bones with armatures");


    RNA_def_boolean(ot->srna, "active_uv_only", 0, "Only Selected UV Map",
                    "Export only the selected UV Map");

    RNA_def_boolean(ot->srna, "include_uv_textures", 0, "Include UV Textures",
                    "Export textures assigned to the object UV Maps");

    RNA_def_boolean(ot->srna, "include_material_textures", 0, "Include Material Textures",
                    "Export textures assigned to the object Materials");

    RNA_def_boolean(ot->srna, "use_texture_copies", 1, "Copy",
                    "Copy textures to same folder where the .dae file is exported");


    RNA_def_boolean(ot->srna, "triangulate", 1, "Triangulate",
                    "Export Polygons (Quads & NGons) as Triangles");

    RNA_def_boolean(ot->srna, "use_object_instantiation", 1, "Use Object Instances",
                    "Instantiate multiple Objects from same Data");

    RNA_def_boolean(ot->srna, "sort_by_name", 0, "Sort by Object name",
                    "Sort exported data by Object name");

    RNA_def_int(ot->srna, "export_transformation_type", 0, INT_MIN, INT_MAX,
                "Transform", "Transformation type for translation, scale and rotation", INT_MIN, INT_MAX);

    RNA_def_enum(ot->srna, "export_transformation_type_selection", prop_bc_export_transformation_type, 0,
                 "Transform", "Transformation type for translation, scale and rotation");

    RNA_def_boolean(ot->srna, "open_sim", 0, "Export to SL/OpenSim",
                    "Compatibility mode for SL, OpenSim and other compatible online worlds");
}
Example #15
0
void WM_OT_alembic_export(wmOperatorType *ot)
{
	ot->name = "Export Alembic";
	ot->description = "Export current scene in an Alembic archive";
	ot->idname = "WM_OT_alembic_export";

	ot->invoke = wm_alembic_export_invoke;
	ot->exec = wm_alembic_export_exec;
	ot->poll = WM_operator_winactive;
	ot->ui = wm_alembic_export_draw;
	ot->check = wm_alembic_export_check;

	WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_ALEMBIC,
	                               FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH,
	                               FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);

	RNA_def_int(ot->srna, "start", INT_MIN, INT_MIN, INT_MAX,
	            "Start Frame",
	            "Start frame of the export, use the default value to "
	            "take the start frame of the current scene",
	            INT_MIN, INT_MAX);

	RNA_def_int(ot->srna, "end", INT_MIN, INT_MIN, INT_MAX,
	            "End Frame",
	            "End frame of the export, use the default value to "
	            "take the end frame of the current scene",
	            INT_MIN, INT_MAX);

	RNA_def_int(ot->srna, "xsamples", 1, 1, 128,
	            "Transform Samples", "Number of times per frame transformations are sampled", 1, 128);

	RNA_def_int(ot->srna, "gsamples", 1, 1, 128,
	            "Geometry Samples", "Number of times per frame object data are sampled", 1, 128);

	RNA_def_float(ot->srna, "sh_open", 0.0f, -1.0f, 1.0f,
	              "Shutter Open", "Time at which the shutter is open", -1.0f, 1.0f);

	RNA_def_float(ot->srna, "sh_close", 1.0f, -1.0f, 1.0f,
	              "Shutter Close", "Time at which the shutter is closed", -1.0f, 1.0f);

	RNA_def_boolean(ot->srna, "selected", 0,
	                "Selected Objects Only", "Export only selected objects");

	RNA_def_boolean(ot->srna, "renderable_only", 1,
	                "Renderable Objects Only",
	                "Export only objects marked renderable in the outliner");

	RNA_def_boolean(ot->srna, "visible_layers_only", 0,
	                "Visible Layers Only", "Export only objects in visible layers");

	RNA_def_boolean(ot->srna, "flatten", 0,
	                "Flatten Hierarchy",
	                "Do not preserve objects' parent/children relationship");

	RNA_def_boolean(ot->srna, "uvs", 1, "UVs", "Export UVs");

	RNA_def_boolean(ot->srna, "packuv", 1, "Pack UV Islands",
	                "Export UVs with packed island");

	RNA_def_boolean(ot->srna, "normals", 1, "Normals", "Export normals");

	RNA_def_boolean(ot->srna, "vcolors", 0, "Vertex Colors", "Export vertex colors");

	RNA_def_boolean(ot->srna, "face_sets", 0, "Face Sets", "Export per face shading group assignments");

	RNA_def_boolean(ot->srna, "subdiv_schema", 0,
	                "Use Subdivision Schema",
	                "Export meshes using Alembic's subdivision schema");

	RNA_def_boolean(ot->srna, "apply_subdiv", 0,
	                "Apply Subsurf", "Export subdivision surfaces as meshes");

	RNA_def_enum(ot->srna, "compression_type", rna_enum_abc_compression_items,
	             ABC_ARCHIVE_OGAWA, "Compression", "");

	RNA_def_float(ot->srna, "global_scale", 1.0f, 0.0001f, 1000.0f, "Scale",
	              "Value by which to enlarge or shrink the objects with respect to the world's origin",
	              0.0001f, 1000.0f);

	RNA_def_boolean(ot->srna, "triangulate", false, "Triangulate",
	                "Export Polygons (Quads & NGons) as Triangles");

	RNA_def_enum(ot->srna, "quad_method", rna_enum_modifier_triangulate_quad_method_items,
	             MOD_TRIANGULATE_QUAD_SHORTEDGE, "Quad Method", "Method for splitting the quads into triangles");

	RNA_def_enum(ot->srna, "ngon_method", rna_enum_modifier_triangulate_quad_method_items,
	             MOD_TRIANGULATE_NGON_BEAUTY, "Polygon Method", "Method for splitting the polygons into triangles");

	RNA_def_boolean(ot->srna, "export_hair", 1, "Export Hair", "Exports hair particle systems as animated curves");
	RNA_def_boolean(ot->srna, "export_particles", 1, "Export Particles", "Exports non-hair particle systems");

	RNA_def_boolean(ot->srna, "as_background_job", true, "Run as Background Job",
	                "Enable this to run the import in the background, disable to block Blender while importing");

	/* This dummy prop is used to check whether we need to init the start and
	 * end frame values to that of the scene's, otherwise they are reset at
	 * every change, draw update. */
	RNA_def_boolean(ot->srna, "init_scene_frame_range", false, "", "");
}
Example #16
0
void WM_OT_collada_export(wmOperatorType *ot)
{
	static EnumPropertyItem prop_bc_export_mesh_type[] = {
		{BC_MESH_TYPE_VIEW, "view", 0, "View", "Apply modifier's view settings"},
		{BC_MESH_TYPE_RENDER, "render", 0, "Render", "Apply modifier's render settings"},
		{0, NULL, 0, NULL, NULL}
	};

	ot->name = "Export COLLADA";
	ot->description = "Save a Collada file";
	ot->idname = "WM_OT_collada_export";
	
	ot->invoke = wm_collada_export_invoke;
	ot->exec = wm_collada_export_exec;
	ot->poll = WM_operator_winactive;

	ot->flag |= OPTYPE_PRESET;

	ot->ui = wm_collada_export_draw;
	
	WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);

	RNA_def_boolean(ot->srna,
	                "apply_modifiers", 0, "Apply Modifiers",
	                "Apply modifiers to exported mesh (non destructive))");

	RNA_def_int(ot->srna, "export_mesh_type", 0, INT_MIN, INT_MAX,
	            "Resolution", "Modifier resolution for export", INT_MIN, INT_MAX);

	RNA_def_enum(ot->srna, "export_mesh_type_selection", prop_bc_export_mesh_type, 0,
	             "Resolution", "Modifier resolution for export");

	RNA_def_boolean(ot->srna, "selected", 0, "Selection Only",
	                "Export only selected elements");

	RNA_def_boolean(ot->srna, "include_children", 0, "Include Children",
	                "Export all children of selected objects (even if not selected)");

	RNA_def_boolean(ot->srna, "include_armatures", 0, "Include Armatures",
	                "Export related armatures (even if not selected)");

	RNA_def_boolean(ot->srna, "deform_bones_only", 0, "Deform Bones only",
	                "Only export deforming bones with armatures");


	RNA_def_boolean(ot->srna, "active_uv_only", 0, "Only Active UV layer",
					"Export textures assigned to the object UV maps");

	RNA_def_boolean(ot->srna, "include_uv_textures", 0, "Include UV Textures",
					"Export textures assigned to the object UV maps");

	RNA_def_boolean(ot->srna, "include_material_textures", 0, "Include Material Textures",
					"Export textures assigned to the object Materials");

	RNA_def_boolean(ot->srna, "use_texture_copies", 1, "Copy", 
	                "Copy textures to same folder where the .dae file is exported");


	RNA_def_boolean(ot->srna, "use_object_instantiation", 1, "Use Object Instances",
	                "Instantiate multiple Objects from same Data");

	RNA_def_boolean(ot->srna, "sort_by_name", 0, "Sort by Object name",
	                "Sort exported data by Object name");

	RNA_def_boolean(ot->srna, "second_life", 0, "Export for Second Life",
	                "Compatibility mode for Second Life");
}