Skip to main content

CLO Help Center

How can we help you?

Python Script API

Comments

  • priyash

    How to use load morph target  through python script ?

    0
  • vineet

    The example provided is not working.

    Function called is the following:
    #this function is example for multi process
    def run_multi_example_with_obj_exoprt_option(self, object):
    # clear console window
    object.clear_console()
    #initialize mdsa module
    object.initialize()

    #Set importing options (unit) of string type
    object.set_import_scale_unit("mm")

    #Set exporting options (unit) of string type
    object.set_export_scale_unit("mm")

    #Set exporting options (only export option)
    object.on_export_garment_with_relative_objects_only()

    #Set exporting options (multi object option)
    object.on_export_multi_object()
    #Set exporting options (weld option)
    object.on_export_weld()
    #Set exporting options (thick option)
    object.on_export_thick()

    #Set exporting options (unified UV coordinates option)
    # first value : Unified Textures of boolean type
    # second value : Texture Size(Width & Height) of integer type
    # third value : Fill Texture Seams of integer type
    # fourth value : Texture Margin Property
    # True(absolute length(mm)) , False(relative uv coordinate (0-1))
    # fifth value : Texture Margin Value
    object.set_export_unified_uv_texcoordnate(True, 1000, 5, True, 0.01)

    #Set exporting options (include inner shape option)
    #object.on_export_include_inner_shape()
    #Set exporting options (save with texture files(ZIP) option)
    #object.on_export_save_with_texture()
    #Set exporting options (save with meta data(XML) option)
    #object.on_export_save_meta_data()
    #Set exporting options (Diffuse Color Combined on Texture option)
    object.on_export_diffuse_color_combined()
    #Set exporting options (Exclude Ambient Color option)
    object.on_export_exclude_ambient_color()

    #Set exporting options (Axis Conversion option) of string type
    object.set_export_axis_x("Y")
    object.set_export_axis_y("Z")
    object.set_export_axis_z("X")

    #Set exporting options (Axis Invert option)
    object.on_export_invert_x()
    object.on_export_invert_y()
    object.on_export_invert_z()

    #In case want to simulate/record one garment and avatar with multiple animation
    #set path of one garment file
    object.set_garment_file_path("C:\\Users\\Public\\Documents\\MarvelousDesigner\\Assets_ver_5.1.99999\\Garment\\ambient_test.zpac")

    #set path of one avatar file
    object.set_avatar_file_path("C:\\Users\\Public\\Documents\\MarvelousDesigner\\Assets_ver_5.1.99999\\Avatar\\Avatar\\Female_A\\Female_A_V3.avt")
    object.set_animation_file_path("C:\\Users\\Public\\Documents\\MarvelousDesigner\\Assets_ver_5.1.99999\\Avatar\\Pose\\Female_A")
    #set save folder and extension (file extension must be supported by Marvelous Designer)
    object.set_save_folder_path("C:\\Users\\Public\\Documents\\MarvelousDesigner\\Assets_ver_5.1.99999\\Output", "fbx")
    #set auto save option. True is save with Zprj File and Image File.
    object.set_auto_save(False)
    #call the "process" function (to autosave project file, change factor to ture)
    object.process()

    All the resources are present and when the function is called you can see that item is loaded but there is no resulting obj.

    Here is the console output:
    Warning: not found last character /

    new File Path
    MV1_01_A
    MV1_01_AMV1_Dario
    MV1_01_AMV1_Dario1.Zpac

    0
  • novneet

    Is anyone able to save the textures using this script?
    Hi Vineet, can we discuss what you are facing?
    I am able to save the obj and fbx files.

    0
  • hongwbu

    I have the same issues as vineet. The save-obj function does not save any .obj files

    0
  • Alex

    There has been some issue with the CLO 6.1 python script API. The problem has been resolved in the 6.2 python script API. Apologies for the inconvenience.

    0
  • enflure

    Hi everyone!

    I'm looking for a way to use options (which are in the CloApiData.h) the ExportGLTF.

    I tried several things that doesn't work... What do I need to import in order to use ImportExportOption? How to call it ? 

    My code works but I want to use options.

    Best regards

    /// @fn ExportGLTF(const string& _filePath, const Marvelous::ImportExportOption& _options)
    /// @brief Export GLTF
    /// @param options: If "options" is given, it exports GLTF according to options, not allowing user for selecting options in Export Dialog.
    /// @return Output file paths.
    virtualstd::vector<std::string> ExportGLTF(conststd::string&_filePath, constMarvelous::ImportExportOption&_options, bool_bGLBinary)
    {
    std::vector<std::string>interface_vector;
    returninterface_vector;
    }

    0
  • michaellevifx

    mdsa  - import this or using it is not working. Clo 7.3. Can't use any of the methods above. Initial lines of example.py (I found it on the web) also not importing. In sys.modules , sys.path, globals - nothing specific - seems like pure python and that's all. Should I somehow download python api or what can be the issue?

    0