Objective
Learn the variables used in Python Script API.
※Note:
Location of Example File:
- Marvelous Designer install folder
How to Execute Example File:
- Please type below text in Script Console
- py> import example
- py> from example import *
- py> exam = example()
- py> exam.function(mdsa)
- Function is example, please find usable function from example.py file.
- mdsa is python module which allows you to use functions of Marvelous Designer from python.
Operation
2.When the Python Script console appears, type in the desired API.
*Module Reload is available from the Marvelous Designer version 10.
1. Close the Script Window.
2. Drag and drop the Script File to reload to the 3D Window.
In addition, you can use the Reload function in the Script Window the same way you reload from Python.
* Support Python 3.7 version from the MarvelousDesigner version 10.
* PythonQt is not supported.
API
#mdsa = Marvelous Designer Script API
Variable
Variable name |
Type |
Explication |
open_avatar_file_list
|
String List
|
List type Variable, designate directory of Avatar files want to open. |
open_garment_file_list |
String List
|
List type Variable, designate directory of Garment files want to open. |
open_animation_file_list |
String List
|
List type Variable, designate directory of Animation files want to open. |
open_fabric_file_list | String List |
List type Variable, designate directory of Fabric files you want to open. |
save_file_path_list |
String List
|
List type Variable, designate directory and name of files will be saved. |
obj_type_list |
Integer List
|
List type Variable, saves Type of Avatar want to use. |
simulation_quality_list |
Integer List
|
List type Variable, designate Simulation Quality. |
simulation_delay_time_list |
Integer List
|
List type Variable, designate time of default pose Simulation. |
export_scale_unit |
String |
Variable, designate scale of object by unit when exporting. |
export_fps | Integer |
Variable, designate fps of object when exporting.
|
export_weld | Boolean | Variable, combine and save the duplicate vertex when you export a garment. |
export_thin | Boolean | When you export a garment, determine the thickness of the garment. If false, it will be exported in a thick state. Default value is True. |
export_unified_uv_coordinates |
Boolean
|
Variable, decide whether unify UV or not when exporting. |
import_scale_unit | String |
Variable, designate scale of object by unit when importing.
|
import_fps | Integer |
Variable, designate fps of object when importing.
|
current_process | Integer |
‘Process’ represent a flow of ‘file open -> simulation-> Animation -> Saving file’. Multiple ‘Process’ can be calculated at the same time. We do not recommend to access this variable. |
save_folder_path | String |
Variable, designate save folder.
|
save_capture_image_folder_path | String | Variable, designate the capture image folder. |
avatar_skin_offset | String | Variable, set the offset between Garment and Avatar Skin. |
module_obj | Marvelous Designer Module | Internal API module of Marvelous Designer. We do recommend not to access this variable. Direct use of this variable may cause malfunction. |
export_include_pattern | Boolean |
Variable, decide whether to include patterns when exporting. If False, export excluding Pattern. Default value is False. |
export_include_piping_pattern | Boolean |
Variable, decide whether to include piping patterns when exporting. If False, export excluding Piping Pattern. Default value is False. |
export_include_zipper_teeth_pattern | Boolean |
Variable, decide whether to include Zipper teeth when exporting. If False, export excluding Zipper teeth. Default value is False. |
export_include_avatar | Boolean |
Variable, decide whether to include Avatar when exporting. If False, export excluding Avatar. Default value is False. |
export_include_trim | Boolean |
Variable, decide whether to include Trim when exporting. If False, export excluding Trim. Default value is False. |
export_include_graphics | Boolean |
Variable, decide whether to include Graphic when exporting. If False, export excluding Graphic. Default value is False. (If export_unified_texture variable is True, the setting of this variable is ignored and the Graphic is not exported.) |
export_include_top_stitch | Boolean |
Variable, decide whether to include Top stitch when exporting. If False, export excluding Top stitch. Default value is False. |
export_include_zipper_puller_and_slider | Boolean |
Variable, decide whether to include Zipper puller and slider when exporting. If False, export excluding Zipper puller and slider. Default value is False. |
export_include_button_hole | Boolean |
Variable, decide whether to include Button hole when exporting. If False, export excluding Button hole. Default value is False. (If export_unified_texture variable is True, the setting of this variable is ignored and the Button hole is not exported.) |
export_include_button_head | Boolean |
Variable, decide whether to include Button head when exporting. If False, export excluding Button head. Default value is False. |
export_include_obj_stitch | Boolean |
Variable, decide whether to include obj stitch when exporting. If False, export excluding obj stitch. Default value is False. |
export_unified_texture | Boolean |
Variable, decide whether to save the texture image of the garment as a new image by baking. This variable only works when export_unified_uv_coordinates variable is True. Default value is False. |
export_fill_texture_seams | Integer |
Variable, extend the range of textures by the value you entered, based on the bounderline of the texture. Minimum: 0 Maximum: 15 This variable only works when export_unified_texture variable is True. |
export_texture_size | Integer |
Variable, decide the size of image to bake. The aspect ratio is 1:1. This variable only works when export_unified_texture variable is True. |
export_single_object | Boolean |
Variable, decide whether to save the objects as one Object. If True, the entire garments are saved as one Object. Default value is True. |
export_save_with_texture | Boolean |
Variable, decide whether to save the loaded Texture Image as a file.If True, the image file is saved in the same location as the file you want to save. Default value is False. |
export_diffuse_color_combined | Boolean |
Variable, decide whether to bake the Material Color and Texture Image applied in each pattern when saving the Texture Image. This variable only works when export_save_with_texture variable is True. Default value is False. |
export_exclude_ambient_color | Boolean |
Variable, decide whether to exclude the Ambient Color value among the Material Color applied to the pattern when exporting. If True, materials are saved except Ambient Color. Default value is False. |
export_include_inner_shape | Boolean |
Variable, decide whether to include the internal lines applied to the Pattern when exporting. If True, the internal lines are saved in the Curve form. (Valid only when saving OBJ File.) Default value is False. |
export_save_meta_data | Boolean |
Variable, decide whether to save Pattern(Mesh), physical property, and sewing information as Meta Data(xml format) when exporting. Default value is False. |
export_invert_x | Boolean |
Variable, decide whether to reverse the value of the x-axis when exporting. If Ture, the value on the x-axis is converted to a negative value. Default value is False. |
export_invert_y | Boolean |
Variable, decide whether to reverse the value of the y-axis when exporting. If Ture, the value on the y-axis is converted to a negative value. Default value is False. |
export_invert_z | Boolean |
Variable, decide whether to reverse the value of the z-axis when exporting. If Ture, the value on the z-axis is converted to a negative value. Default value is False. |
simulation_quality | Integer |
Variable, decide the preset of Simulation. 0 sets to Complete, 1 to Normal, and 2 to Custom. Default value is 1. |
simulation_time_step | Floating point |
Variable, decide the interval of Simulation from one time to the end. Default value is 0.03333333. |
simulation_number_of_simulation | Integer |
Variable, run the simulation as many as the times you entered for each time step. If the value exceeds 1, run the simulation as many times you entered for each time step. Default value is 1. |
simulation_cg_finish_condition | Integer |
Variable, modify the Conjugate Gradient end condition for Simulation. 0 for Iteration, 1 for Residual. Default value is 0. |
simulation_cg_iteration_count | Integer |
Variable, designate the number that Conjugate Gradient is calculated. The lower the value, the higher the speed, the lower the accuracy. The higher the value, the lower the speed, and the higher the accuracy. Default value is 50. |
simulation_cg_residual | Integer |
Variable, designate the Conjugate Gradient accuracy deviation. The lower the value, the higher the accuracy, the lower the speed. The higher the value, the lower the accuracy, and the higher the speed. Default value is 0.000100. |
simulation_self_collision_iteration_count | Integer |
Variable, modify the Time step property of the Simulation Property. Default value is 1. |
simulation_air_damping | Floating point |
Variable, designate an air damping. |
simulation_gravity | Integer |
Variable, designate the strength of gravity. Default value is -9800. |
simulation_number_of_cpu_in_use | Integer |
Variable, designate the number of CPUs in use for Simulation. Default value is 4. |
simulation_nonlinear_simulation | Boolean |
Variable, decide whether to apply Nonlinear Simulation setting. Default value is False. |
simulation_ground_collision | Boolean |
Variable, decide whether to apply Ground Collision setting. Default value is True. |
simulation_ground_height | Boolean |
Variable, decide the height from the Ground to inspect the Collision. Default value is 0.0. |
simulation_avatar_cloth_collision_detection_triangle_vertex | Boolean |
Variable, decide the Collision detection option between avatar and cloth. Default value is True. |
simulation_self_collision_detection_triangle_vertex | Boolean |
Variable, decide whether to deal with collision between triangles and vertex when dealing with collision between cloths. Default value is True. |
simulation_self_collision_detection_edge_edge | Boolean |
Variable, decide whether to detect a collision between edge and edge when dealing with a collision between garments. Default value is True. |
simulation_self_collision_detection_avoidance_stiffness | Floating point |
Variable, designate the value to manage collision between garments.
|
simulation_proximity_detection_vertex_triangle | Boolean |
Variable, decide whether to deal with a collision between vertex and triangle. If True, it checks the distance between vertex and triangle, if close, drop each other off with appropriate force. If False, it does nothing. |
simulation_proximity_detection_edge_edge | Boolean |
Variable, decide whether to deal with a collision between edges. If True, it checks the edge-to-edge distance and, if close, drop each other off with appropriate force. If False, it does nothing. Default value is True. |
simulation_intersection_resolution | Boolean |
Variable, decide whether to proceed Intersection Resolution. Intersection resolution is a function that effectively reduces the cross-section of the garments where the collision occurred. |
simulation_layer_based_collision_detection | Boolean |
Variable, decide whether to do Simulation by reflecting Layer. Default value is True. |
wind_activate | Boolean |
Variable, decide the activate state of the wind. Default value is True. |
wind_type | Integer |
Variable, decide the type of wind. If wind type is 0, sphercal. 1, then planar. Default value is 1. |
wind_strength | Floating point |
Variable, decide the strength of the wind. |
wind_decay | Floating point |
Variable, decide the distance that wind effects. The wind weakens along parabolic line by the set value |
wind_frequency | Boolean |
Variable, decide the frequency of the wind. This value sets the wind cycle. Depend on set value interval in seconds, the winds become weaker and stronger. Default value is 0.00. |
wind_turbulence | Boolean |
Variable, decide the degree of turbulence of the wind strength. The larger the value, the more irregular. |
wind_x | Floating point |
Variable, decide the x coordinate position of the wind controller. |
wind_y | Floating point |
Variable, decide the y coordinate position of the wind controller. |
wind_z | Floating point |
Variable, decide the z coordinate position of the wind controller. |
capture_width | Integer | Variable, decide the width value of the image you want to save when you capture the current 3D screen. Default value is 1920. |
capture_height | Integer |
Variable, decide the height value of the image you want to save when you capture the current 3D screen. Default value is 1080. |
bOgawa | Boolean |
Variable, if True, save the Alembic file as Ogawa type. |
auto_save_zprj_file | Boolean |
Variable, automatically save the current scene as a Zprj file when saving the file. Default value is True. |
Function
def initialize(object):
- Reset mdsa object currently use.
def clear_console(object):
- Clear console window.
def get_split_string(object, string, split_filter_list):
- String = string type, split_filter_list = string list type
- This function returns a string list (string list = source string / split_filter_list. Split_filter_list is the list of standard string for split. get_split_string function split Split_filter_list from first string. If the string is not available to split by first string (If a character is not included in string) It Sequentially look up next string. If it find a string which can be split from split_filter_list, it returns split string list. If it could not find a string which can be split, it will return empty string list. Split_filter character will be excluded from string list.
- get_split_string(“C:\Users\Public\Documents\Marvelous Designer\Assets_ver_3.0.9999\default.zpac”, [“\\”, “/”])
- [“C:”, “Users”, “Public”, “Documents”, “Marvelous Designer”, “Assets_ver_3.0.9999”, “default.zpac”]
def get_file_name(object, file_path):
- file_path is string type
- This function only returns file_name which received from file_path as a factor.
- It includes a file extention.
- get_file_name(“C:\Users\Public\Documents\Marvelous Designer\Assets_ver_3.0.9999\default.zpac”)
- default.zpac
def get_file_name_except_ext(object, file_path):
- file_path is string type
- This function only returns file_name which received from file_path as a factor.
- It doesn't include a file extention.
get_file_name(“C:\Users\Public\Documents\MarvelousDesigner\Assets_ver_3.0.9999\default.zpac”)
- default
def get_filter_file_name(object, file_list, filter):
- file_list is string list type, filter is string type
- This function returns list of files with certain extension which received as a factor from file_list. It is case insensitive when look up file extention.
def make_valid_folder_path(object, folder_path):.
- Folder_path is string type
- If the last letter of path is not “\” or “/”, it is recognized as invalid path. This function changes an invalid path to the valid form and return.
def get_entry_list(object, folder_path):
- Folder_path is string type
- get_entry_list returns a list of file from Folder_path.
def set_open_option(object, unit = "none", fps = 30):
- Unit is string type, allows you to set unit value as "cm", "mm", "inch", "feet", "m". default value is "mm".
- Fps is integer type, default is 30 fps.
- set_open_option designates import options of obj, cache, fbx and alembic file. This function only decides values. To apply this value to Marvelous Designer, must call set_app_open_option function.
def set_save_option(object, unit = "none", fps = 30, unified = False, thin = True, weld = False):
- unit is string type allows you to set unit value as "cm", "mm", "inch", "feet", "m". default is "mm".
- Fps is integer type, default is 30 fps
- Unified is Boolean type, when it is True, it changes value of object’s UV from 0 to 1. Default is False.
- thin is Boolean type. If True, the value of thickness is not exported to Geometry. If False, the value of rendering thickness is exported to Geometry. Default value is True.
- weld is Boolean type. If True, combines the Vertex (points of the mesh) of the parts of the pattern that are sewn together into one line into one point. If False, exports the Vertex (points of the mesh) of the parts of the pattern that are sewn together into one line into multiple objects.
- Setting export option of obj, cache, fbx, alembic and Garment file. This function only decides values. To apply this value to Marvelous Designer, must call set_app_save_option function.
def run_app_open_option(object):
- run_app_open_option apply values which saved at set_open_option function and designates import option of Marvelous Designer.
def run_app_save_option(object):
- run_app_save_option apply values which saved at set_save_option, it designates export option of Marvelous Designer.
def run_app_open_option(object, index):
- index is integer type
- This function apply value which saved at set_open_option, it designates export option of Marvelous Designer.
- If option is set list at set_open_option, it send index of designated items to factor. Minimum value of Index is -0 and total list size value of -1 is the maximum value of index.
def set_avatar_file_path(object, open_avatar_file_path):
- open_avatar_file_path is string type.
- Add avatar file path. If the count does not match with other files, the last avatar file path will be loaded.
def set_avatar_file_path_list(object, open_avatar_file_path_list):
- open_avatar_file_path_list is string list type
- Set avatar file list. It is used to set external list type value. If the count does not match with other file lists, the last avatar file path will be loaded.
def set_garment_file_path(object, open_garment_file_path):
- open_garment_file_path is string type
- Add garment file path. . If the count does not match with other files, the last garment file path will be loaded.
def set_garment_file_path_list(object, open_garment_file_path_list):
- open_garment_file_path_list is string list type
- Sets garment file list. It is used to set external list type value. If the count does not match with other file lists, the last garment file path will be loaded.
def set_animation_file_path(object, open_animation_file_path):
- open_animation_file_path is string list type
- Sets animation file list. It is used to set external list type value. If the count does not match with other file lists, the last animation file path will be loaded.
def set_animation_file_path_list(object, open_animation_file_path_list):
- open_animation_file_path_list is string list type
- Sets animation file list. It is used to set external list type value. If the count does not match with other file lists, the last animation file path will be loaded.
def set_simulation_options(object, obj_type = 0, simulation_quality = 0, simulation_delay_time = 5000, process_simulation = True):
- obj_type is integer type, it loads object depends its value obj_type = 0 is avatar, if it is 1 trim object, if it is 2 obj to garment. Default is avatar type.
- Simulation_quality is integer type, it defines simulation quality by value 0 = Normal, 1 = complete, 2 = Custom type. Default is Normal.
- Simulation_delay_time is integer type, this Value represents the time of simulation before animation for stabilization. Default is 5000 micro seconds, (micro seconds = seconds*1000)
- Process_simulation is boolean type, this decides whether proceed simulation. Default is True.
- This function Adds Import options related to obj type and simulation. If the count does not match with files which will be imported or option is not set, value will be set to default.
def avatar_file_open(object, open_file_path, obj_type = 0, scale = "mm", fps = 30):
- open_file_path is string type, obj_type is string type, scale is string type, fps is integer type
- This function loads avatar files (avt, obj, fbx, alembic) located in open_file_path. Also applies saved obj_type, scale, fps option.
def garment_file_open(object, open_file_path):
- open_file_path is string type,
- This function loads garment (zpac, pac, zprj) file located in open_file_path.
def animation_file_open(object, open_file_path, scale = "mm", fps = 30):
- open_file_path is string type, scale is string type, fps is integer type
- This function loads animation (pos, mc, mcx, pc2, mdd) located in open_file_path file. Also applies saved scale, fps option.
def save_file_stand_alone(object, file_path, scale = "mm", fps = 30, unfined_map = True):
- File_path is string type, scale is string type, fps is integer type, unified_map은 Boolean type
- This function saves loaded files to file_path. It automatically designates file type depends on extension saved in File_path when saving. Also applies saved scale, fps, unified_map option.
def SimulationOn(object, time):
- Time is integer type, micro seconds (seconds * 1000)
- Start simulation after designated time.
def SimulationOff(object, time, signal_on = False):
- time is integer type, micro seconds (seconds * 1000)
- signal_on is a parameter that decides whether to capture the 3D Window when stopping Simulation. If true, stop simulation and capture the current 3D Window.
- Stop simulation after designated time.
def SimulationOffWithNextFunction(object, time, signal_on = False, next_function = True):
- time is integer type, micro second (second * 1000)
- signal_on is a parameter that decides whether to capture the 3D Window when stopping Simulation. If true, stop simulation and capture the current 3D Window.
- next_function parameter decides whether to call the _physical_second_process function after
Simulation stops.
- This function stops the simulation after the specified time and calls the _physical_second_process function according to the value of the parameter.
def SimulationSetting(object):
- The function sets the Simulation-related variables (For more information, see the variable description section.
- This function must be called to apply the Simulation-related values in the program.
def StartAnimationRecord(object, time):
- Time is integer type, micro seconds (seconds * 1000)
- After designated time, start and record Animation.
def set_save_file_path(object, save_file_path):
- save_file_path is string type
- This function add path which received from factor to save_file_path_list. save_file_path_list need to be match at least one of saved import file list.
- This can be replaced by setting set_save_folder_path. Either of one must be set.
def set_save_folder_path(object, save_folder_path, extension = "zprj"):
- save_folder_path is string type
- This function sets the path which received from factor as save folder path. Save folder path save files as Zprj. The name of file will be the same with import file list which have largest count.
- The extension parameter determines the format of the files to be saved. Default is Zprj. (You can designate any file extensions for all file formats that are supported in the Marvelous Designer.)
- This can be replaced by setting set_save_file_path. Either of one must be set.
def set_garment_folder(object, garment_folder_path, filter = "zpac"):
- garment_folder_path is string type, filter is string type
- This function loads garment files from designated folder and set by open_garment_file_list. In case setting Filter value, it sets open_garment_file_list by extension which saved at filter.
- Default setting of Filter is “zpac”.
def set_avatar_folder(object, avatar_folder_path, filter = "avt"):
- avatar_folder_path is string type, filter is string type
- This function loads avatar files from designated folder and set by open_avatar_file_list로. In case setting Filter value, it sets open_avatar_file_list by extension which saved at filter. (?)
- Default setting of Filter is “avt”.
def set_animation_folder(object, animation_folder_path, filter = "pos"):
- animation_folder_path는 string type, filter는 string type
- This function loads animation files from designated folder and set by open_animation_file_list. In case setting Filter value, it sets open_animation_file_list by extension which saved at filter.
- Default setting of Filter is “pos”.
def set_fabric_folder(object, fabric_folder_path, filter = "zfab"):
- Read the fabric files in the path of the fabric_folder_path parameter and set them to open_fabric_file_list. If you set the Filter value, set files of the Filter extension to the open_fabric_file_list (Only Fabric Format is supported).
- The default of the filter is "Zfab".
def get_max_count(object):
- This function returns the item count of the biggest size list among file lists which will be opened.
def set_auto_save(object, bAutosave) :
- This function decides whether Marvelous Designer Project file (Zprj) is saved.
- If bAutoSave is True, Project (Zprj)file will be saved as the same name with the file you export as a specific format.
- Default status of Autosave is 'True'.
def on_save_zprj_with_metadata_info(object, bWith_meta_data, image_number, save_type):
- bWith_meta_data is a boolean type and stores metadata together if it is true.
- image_number is the number of snapshots in the scene to be saved. image rotates 360 degrees and stores the snapshot. The angle of rotation for each snapshot is determined by image_number / 360. It only works if with_meta_data is True.
- The save type determines how meta_data is stored. If set to 0, create a folder with the same name as the project file to be saved, and save the xml file and images under the folder. 1, all meta data will be compressed and stored as a zip file.
- Save Metadata when saving Zprj. Please refer to manual for more info about Metadata.
def on_export_garment_only(object):
- This function sets only Garments to be exported from the Scene.
def on_export_garment_with_relative_objects_only(object):
- This function sets all Scene objects to be exported except Avatar.
def on_export_avatar_only(object):
- This function allows you to export only avatars from the Scene.
def on_export_piping_pattern_only(object):
- This function sets only the piping pattern of the scene to be exported.
def on_export_zipper_teeth_pattern_only(object):
- This function sets only the zipper teeth pattern of the scene to be exported.
def on_export_trim_only(object):
- This function sets only trim to be exported from the scene.
def on_export_graphics_only(object):
- This function sets only graphics to be exported from the scene.
def on_export_zipper_puller_and_slider_only(object):
- This function sets only the zipper puller and the slider of the entire scene to be exported.
def on_export_button_hole_only(object):
- This function sets the only buttonhole to be exported from the scene.
def on_export_button_head_only(object):
- This function sets only the button head of the scene to be exported.
def on_export_obj_stitch_only(object):
- This function sets only stitch to be exported from the scene.
Note. if export_(something)_only option is not set, all object will be exported. These options only work with obj export.
def on_export_single_object(object):
- This function sets merge entire mesh into one mesh and export.
- This function can not be used at the same time with on_export_multi_object function. If it is used at the same time, it is set to the last used function.
def on_export_multi_object(object):
- This function sets to export entire mesh in the scene as the individual mesh.
- This function can not be used at the same time with on_export_single_object function. If it is used at the same time, it is set to the last used function.
def on_export_save_with_texture(object):
- This function set to export texture and export file as a zip file.
def on_export_diffuse_color_combined(object):
- This function set to save texture image and diffuse color designated to the garment as one image.
def on_export_exclude_ambient_color(object):
- This function sets the material to be saved except the Ambient value among the color values set in the garment.
def on_export_include_inner_shape(object):
- This function sets the information of the inner shape included in the garment to be saved together.
def on_export_save_meta_data(object):
- This function set to export with Metadata. Please refer to manual for more info about Metadata.
def set_export_unified_uv_texcoordnate(object, bTexture_bake, texture_bake_size, fill_texture_seam, bTextureBake_relateive = True, texture_bake_margin = 0.01):
- bTexture_bake exports as an image. texture_bake_size determines the resolution of the texture to be saved when the btexture_bake option is set to True. min - max is 100 - 10000 pixelon_export_zipper_teeth_pattern_only and sets the width and height of the image to the designated size.
- This function sets multiple textures to be saved as an image.
- Marvelous Designer uses texture coordinates and does not use normal UV (0 - 1) coordinates. This function can be set to convert UVs between 0-1 when exporting.
def set_export_axis_x(object, axis):
- axis can be set to string type "Y" or "Z". axis is not case-sensitive.
- This function changes the x-axis to the axis entered. When you set this function, the axis is automatically converted to the x-axis.
def set_export_axis_y(object, axis):
- axis can be set to string type "X" or "Z". axis is not case-sensitive.
- This function changes the y-axis to the axis entered. When you set this function, the axis is automatically converted to the y-axis.
def set_export_axis_z(object, axis):
- axis can be set to string type "X" or "Y". axis is not case-sensitive.
- This function changes the z-axis to the axis entered. When you set this function, the axis is automatically converted to the z-axis.
def on_export_invert_x(object):
- This function sets the x-axis to invert.
def on_export_invert_y(object):
- This function sets the y-axis to invert.
def on_export_invert_z(object):
- This function sets the z-axis to invert.
def go_animation_first_frame(object):
- This function can set to export the scene of the frame after moving to the first frame of the animation. If you call this function, you do not export immediately. This function affects the export function as it progresses through the process function.
- This function can not be used simultaneously with the go_animation_end_frame function, and go_animation_first_frame takes precedence.
def go_animation_end_frame(object):
- This function can be set to export the scene of the frame after moving to the last frame of the animation. If you call this function, you do not export immediately. This function affects the export function as it progresses through the process function.
- This function can not be used simultaneously with the go_animation_first_frame function, and go_animation_first_frame takes precedence.
def set_windcontroller_wind_activate(object, bActivate):
- bActivate is boolean type. default is True.
- This function changes the activation state of the wind controller.
def set_windcontroller_wind_type(object, windType):
- windType is an integer type. If wind type is 0, sphercal. 1, then planar. default is 1.
- This function sets the type of wind.
def set_windcontroller_wind_strength(object, strength):
- strength is floating point type. default is 1000.00
- This function sets the wind strength.
def set_windcontroller_wind_decay(object, decay):
- decay is a floating point type. default is 0.00
- This function sets the distance that the wind effects. The wind weakens along parabolic line by the set value.
def set_windcontroller_wind_frequency(object, frequency):
- frequency is floating point type. default is 0.00
- This function sets the wind cycle. Depend on set value interval in seconds, the winds become weaker and stronger.
def set_windcontroller_wind_turbulence(object, turbulence):
- Turbulence is a floating point type. default is 30.00
- This function sets the irregular degree of wind intensity. The larger the value, the more irregular.
def set_windcontroller_translate_x(object, x):
- x is a floating point type. default is -700.00
- This function sets the x coordinate position of the wind controller.
def set_windcontroller_translate_y(object, y):
- y is a floating point type. default is 1000.00
- This function sets the y coordinate position of the wind controller.
def set_windcontroller_translate_z(object, z):
- z is a floating point type. default is 300.00
- This function sets the z coordinate position of the wind controller.
def on_windcontroller(object):
- The function sets the Wind Controller-related variables (For more information, see the variable description section.
- This function must be called to apply the Wind Controller-related values in the program.
def set_skin_offset(object, offset):
- offset is floating point type. default is 3.0
- This function sets the distance between the avatar and the garment.
def set_simulation_quality(object, qulity):
- quality is integer type. 0 sets to Complete, 1 to Normal, and 2 to Custom. Default value is 1.
- This function decides the preset of Simulation.
def set_simulation_time_step(object, time_step):
- time_step is floating point type. Default value is 0.03333333.
- This function runs a Simulation by the time you set.
def set_simulation_number_of_simulation(object, number_of_Simulation):
- number_of_Simulation은 integer type. default는 1.
- This function runs as many times as Simulation you entered for each time step.
- If 1, it runs one Simulation per time step. If the value exceeds 1, run the Simulation as many times you entered for each time step.
def set_simulation_cg_finish_condition(object, cg_finish_condition):
- cg_finish_condition is integer type. Default value is 0.
- This function modifies the Conjugate Gradient end condition for Simulation. 0 for Iteration, 1 for Residual.
- Simulation Conjugate Gradient is a technique to improve the accuracy of Simulation.
- Accuracy increases in proportion to time. The Conjugate Gradient requires a condition as to when to end the calculation.
1) iteration count : It designates the number that Conjugate Gradient is calculated and makes the simulation speed constant. Choose this when simulation speed is important. The lower the value, the higher the speed, the lower the accuracy. The higher the value, the lower the speed, and the higher the accuracy.
2) residual : It designats the Conjugate Gradient accuracy deviation and makes the simulation accuracy constant. Choose this when simulation accuracy is important. The lower the value, the higher the accuracy, the lower the speed. The higher the value, the lower the accuracy, and the higher the speed.
def set_simulation_cg_iteration_count(object, simulation_cg_iteration_count):
- simulation_cg_iteration_count은 integer type. default는 50.
- This function designates the number that Conjugate Gradient is calculated.
- The lower the value, the higher the speed, the lower the accuracy.
The higher the value, the lower the speed, and the higher the accuracy.
def set_simulation_cg_residual(object, CGResidual):
- CGResidual은 floating point type. default는 0.000100.
- This function designate the Conjugate Gradient accuracy deviation.
- The lower the value, the higher the accuracy, the lower the speed.
The higher the value, the lower the accuracy, and the higher the speed.
def set_simulation_self_collision_iteration_Count(object, selfCollisionIterationCount):
- selfCollisionIterationCount is integer type. Default value is 1.
- This function modifies the Time Step property of the Simulation Property.
def set_simulation_air_damping(object, airDamping):
- airDamping is floating point type. Default value is 1.0.
- This function designates an air damping. Air damping controls the speed of an object by air friction.
def set_simulation_gravity(object, gravity):
- gravity is floating point type. Default value is -9800.
- This function designates the strength of gravity.
def set_simulation_number_of_cpu_in_use(object, numberOfCPUInUse):
- numberOfCPUInUse is integer type. Default value is 4.
- This function designates the number of CPUs in use for Simulation.
def set_simulation_nonlinear_simulation(object, bNonlinearSimulation):
- bNonlinearSimulation is boolean type. Default value is False.
- This function decides whether to apply Nonlinear Simulation setting.
def set_simulation_ground_collision(object, bGroundCollision):
- bGroundCollision is boolean type. Default value is True.
- This fuction decides whether to apply Ground Collision setting.
def set_simulation_ground_height(object, groundHeight):
- groundHeight is floating point type. Default value is 0.0.
- This fuction decides the height from the Ground to inspect the Collision.
def set_simulation_avatar_cloth_collision_detection_triangle_vertex(object, bSolidTriangleToClothVertexCollision):
- bSolidTriangleToClothVertexCollision is boolean type. Default value is True.
- This fuction sets the Collision detection option between avatar and garment.
def set_simulation_self_collision_detection_triangle_vertex(object, bVertexTriangleSelfCollision):
- bVertexTriangleSelfCollision is boolean type. Default value is True.
- This function decides whether to deal with collision between triangles and vertex when dealing with collision between garments.
def set_simulation_self_collision_detection_edge_edge(object, bEdgeEdgeSelfCollision):
- bEdgeEdgeSelfCollision is boolean type. Default value is True.
- This fuction decides whether to detect a collision between edge and edge when dealing with a collision between garments.
def set_simulation_self_collision_detection_avoidance_stiffness(object, SelfCollisionStiffness):
- SelfCollisionStiffness is floating point type. Default value is 0.001000.
- This fuction designates the value to manage collision between garments.
A smaller value eliminates the collision of garments when it's close enough, but it's easier to be twisted. A larger value eliminates the twist issues but increases the collision of garments when it's close enough.
def set_simulation_proximity_detection_vertex_triangle(object, bVertexTriangleProximity):
- bVertexTriangleProximity is boolean type. Default value is True.
- This function is to efficiently manage collision between avatars and garments. If True, it checks the distance between vertex and triangle, if close, drop each other off with appropriate force. If False, it does nothing.
def set_simulation_proximity_detection_edge_edge(object, bEdgeEdgeProximity):
- bEdgeEdgeProximity is boolean type. Default value is True.
- This function is to efficiently manage collision between avatars and garments. If True, it checks the edge-to-edge distance and, if close, drop each other off with appropriate force.
def set_simulation_intersection_resolution(object, bIntersectionResolution):
- bIntersectionResolution is boolean type. Default value is True.
- This fuction decides whether to proceed Intersection Resolution. Intersection resolution is a function that effectively reduces the cross-section of the garments where the collision occurred.
def set_simulation_layer_based_collision_detection(object, bUseLayer):
- bUseLayer is boolean type. Default value is True.
- This fuction decides whether to do Simulation by reflecting Layer.
def on_move_garment(object):
- It enables Move Garment option.
- This function moves Garment to the start position of Animation.
def single_process(object, open_garment_path, open_avatar_path, open_animation_path, save_file_path, obj_type = 0, simulation_delay_time = 5000, simulation_quality = 0, simulation = True, auto_save_project_file = True):
- single_process sequentially loads files from path which received from factor and save result to save_file_path.
- obj_type only applied when opened file is obj. if value of obj_type is 0, obj file will be opened as avatar, if it is 1, it is opened as trim object and if it is 2, it will be opened as obj to Garment file.
- simulation_delay_time is used to set a delay time before process animation for stabilization. Opened avatar and garment will simulate with start pose designated time and start animation.
- simulation_delay_time uses micro seconds (1000 == 1 seconds)
- simulation_quality controls precision of Simulation. When the value is 0 it simulate with Normal quality. When it is 1, it simulates with Complete quality. These options of simulation_quality is the same with Simulation quality of Marvelous Designer. Please refer to Marvelous Designer manual for details..
- Simulation factor decides whether it starts simulation after loading files. When it is True, it starts Simulation after load all files. Default value is True.
- auto_save_project_file is the option allows to save Project file to save_file_path. Default value is True.
Note. When calling single_process it only saves file once. Please use “process” function to save multiple files.
def process(object, auto_save_zprj_file = True):
- auto_save_zprj_file is Boolean type, if set auto_save_zprj_file as True, it saves additional Zprj file to the folder which saved to save_file_path or save_folder_path.
- process function open designated files and process and record animation, then save it as animation, garment and avatar file. Import / export setting need to be done before call process function. Process function allows to save and load one or multiple files by saved file list and import / export option.
- Each exported result is set with one import / export option.
Please refer to example.py file for details.
def save_file(object, screen_capture = False, single_save = False):
- This function saves files in preset of the set save_file_path. Run save option set before saving.
- If the value of auto_save_zprj_file is True, save with the project file(.Zprj).
- If there is any remaining process, proceed to the next process.
- screen_capture paramete is currently not used.
- If the value of single_save parameter is True, end without proceeding to the next process, even if there are any remaining processes.
- Typically, this function is called as a callback function when recording an animation finishes in the Marvelous Designer.
- This callback function is called after recording has finished if animation recording is started by calling the process function.
def finish_animation_recording(object):
- This function is one of the callback functions called when animation recording has finished in the Marvelous Designer.
- This callback function is called after animation recording has finished in case you started animation record by calling AnimationRecord function.
def run_(object):
- This function repeats file load - animation record - file save cycle as much as the job saved in the job_tuple_list. If you save a job in the job_tuple_list and call this function, the cycle automatically occurs while running all jobs in the job_tuple_list.
- You can register avatar, animation, and element files as one cycle for a job. (For file formats that contain both animation and avatar, such as fbx or alembic, it works even when avatar and garment files are only used in a job.)
- If you make multiple jobs consisting of each one job with avatar, animation, and garment and save them in the job_tuple_list, the run_ function is automatically called until all of those jobs are performed.
def SaveBoneInformation(object, filePath):
- This function is used when you want to save the Joint information of currently loaded Avatar as boi file format (JSON). (The frame number, joint name, and joint matrix information are saved.)
- It only works when the Avatar has Joint.
- If there is an animation, the Joint information of the avatar in current frame is saved.
def moveFrame(object, frame):
- This function moves the currently loaded animation to frame parameter.
def copyFrame(object, frame):
- This function copies the position information of the garment corresponding to the frame parameter.
def pasteFrame(object, frame):
-This function creates an Animation by pasting a position saved as copyFrame() as a frame parameter.
def set_frame_to_finish(object, frame, bOn):
- If the value of bOn parameter is true, this function records an animation up to frame parameter.
- It only works when there is a copied animation.
Article is closed for comments.