### Create New Directory with PowerShell Source: https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/Installation - README.txt This PowerShell command creates a new directory. It's used by the installation script to set up the plugin subdirectory within the iClone or Character Creator application folders. ```powershell New-Item -Path "$entryValue\$subFolder" -ItemType Directory ``` -------------------------------- ### Start and Stop DataLink Server in CC/iClone Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Initiates and terminates the DataLink server for real-time TCP socket communication with Blender. Ensure the server is running before attempting to connect from Blender. ```python from btp import link # Get or create the DataLink instance data_link = link.get_data_link() # Start listening for Blender connections data_link.link_start() # Check connection status if data_link.is_connected(): print(f"Connected to {data_link.service.remote_app}") # Stop the DataLink data_link.link_stop() ``` -------------------------------- ### Create Directory Junction with mklink Source: https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/Installation - README.txt This command creates a directory junction, a type of symbolic link, which is used by the installer to link the plugin folder to the iClone/Character Creator directories. Ensure you run this in an administrator command prompt. ```batch cmd /c mklink /J "path\to\Bin64\OpenPlugin\Folder Name" "path\to\this\folder" ``` -------------------------------- ### Get Avatar Mesh Materials and Modify Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Retrieves all mesh materials for an avatar using JSON data and demonstrates setting shader type, loading textures, adjusting channel weights, UV mapping, and material properties. Ensure JSON data and FBX paths are correctly specified. ```python avatar = cc.get_first_avatar() json_data = cc.CCJsonData(json_path, fbx_path, character_id) mesh_materials = cc.get_avatar_mesh_materials(avatar, json_data=json_data) for M in mesh_materials: print(f"Mesh: {M.mesh_name}, Material: {M.mat_name}") # Get/set shader type current_shader = M.get_shader() M.set_shader("Pbr") # Pbr, RLSSS, RLSkin, RLEye, RLHair, etc. # Load texture to channel M.load_channel_image( RLPy.EMaterialTextureChannel_Diffuse, "C:/textures/diffuse.png" ) # Set channel texture weight/strength M.set_channel_texture_weight( RLPy.EMaterialTextureChannel_Normal, 100.0 ) # Set UV mapping M.set_uv_mapping( RLPy.EMaterialTextureChannel_Diffuse, offset=(0, 0), tiling=(1, 1), rotation=0 ) # Set material properties M.set_diffuse((1.0, 0.8, 0.6)) M.set_opacity(100.0) M.set_self_illumination(0.0) # Load custom shader texture M.load_shader_texture("Micro Normal Map", "C:/textures/micro_normal.png") # Set shader parameter M.set_shader_parameter("Roughness", 0.5) # Physics component access if M.physics_component(): M.set_physics_param("Stiffness", 50.0) M.set_physics_param("Mass", 1.0) ``` -------------------------------- ### Perform One-Click Export to Blender (Go-B) Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Automates the export process to Blender, including launching Blender, establishing a DataLink connection, and transferring selected characters with scene lighting and camera sync. Use `go_b()` for general export or `go_morph()` for character morph sculpting. ```python from btp import gob, prefs # Check Blender path is configured if prefs.check_paths(create=True): # Go-B exports all selected characters/props to Blender gob.go_b() # Go-B Morph exports character for morph sculpting gob.go_morph() # Go-B automatically: # 1. Creates a project folder with imports/exports subdirectories # 2. Exports selected avatars, props, lights, cameras # 3. Writes a launch script for Blender # 4. Launches Blender with the script # 5. Establishes DataLink connection # 6. Syncs lighting and camera view # 7. Transfers character data over DataLink ``` -------------------------------- ### Import FBX and Reconstruct Materials from Blender Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Imports FBX files from Blender, reconstructing materials and textures using accompanying JSON data. Supports standard characters, humanoids, creatures, and props. Use `json_only=True` for material-only updates on existing avatars. ```python from btp import importer # Create importer for FBX file with accompanying JSON data fbx_path = "C:/DataLink/exports/character/character.fbx" imp = importer.Importer(fbx_path, no_window=True) # Configure for DataLink import (auto-detects from JSON) imp.set_datalink_import() # Import the character - returns list of imported objects imported_objects = imp.import_fbx() # For material-only updates (json_only mode) json_path = "C:/DataLink/exports/character/character.json" imp = importer.Importer(json_path, no_window=True, json_only=True) imp.update_materials(existing_avatar) ``` -------------------------------- ### Live Pose and Animation Transfer with DataLink Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Facilitates real-time transfer of poses and animation sequences between CC/iClone and Blender. Configure transfer options like action name prefixes and keyframe generation. ```python from btp import link data_link = link.get_data_link() if data_link.is_connected(): data_link.send_pose() data_link.send_sequence() data_link.motion_prefix = "Anim_" data_link.use_fake_user = True data_link.set_keyframes = True ``` -------------------------------- ### Create Custom Morph Sliders Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Generate custom morph sliders from sculpted OBJ files. This allows artists to integrate new body morphs into characters. Configure morph name, category, and slider path programmatically. ```python from btp import morph obj_path = "C:/DataLink/exports/morph/body_sculpt.obj" key_path = "C:/DataLink/exports/morph/body_sculpt.ObjKey" morph_slider = morph.MorphSlider(obj_path, key_path) morph_slider.morph_name = "CustomBodyMorph" morph_slider.category = "Body" morph_slider.slider_path = "Custom/Blender" morph_slider.morph_min_value = 0 morph_slider.morph_max_value = 100 morph_slider.auto_apply = True morph_slider.adjust_bones = True morph_slider.create_slider() ``` -------------------------------- ### Send Scene Data via DataLink Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Use DataLink to send various scene elements like actors, motions, morphs, and lighting configurations from CC/iClone to Blender. Ensure the connection is established before sending data. ```python if data_link.is_connected(): data_link.send_actors() data_link.send_motions() data_link.send_morph() data_link.send_scene() data_link.sync_lighting() data_link.send_camera_sync() ``` -------------------------------- ### Remove Directory with cmd Source: https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/Installation - README.txt This command removes a directory, typically used by the uninstallation script to delete existing directory junctions or plugin subdirectories. Ensure you have administrator privileges when running this command. ```batch cmd /c rmdir $junctionPath ``` -------------------------------- ### Export Characters and Scene Data to Blender Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Handles FBX export with JSON material data for avatars, props, lights, and cameras. Configure options for animation, subdivision levels, and texture baking. Use `set_datalink_export` for full scene transfer or `set_datalink_motion_export` for motion-only. ```python from btp import exporter, cc import RLPy # Get selected objects in the scene selected = RLPy.RScene.GetSelectedObjects() # Create exporter for selected objects export = exporter.Exporter(selected, no_window=True) # Configure for DataLink export with custom FPS link_fps = RLPy.RFps(60.0) export.set_datalink_export(fps=link_fps) # Or configure for motion-only export export.set_datalink_motion_export(fps=link_fps) # Execute export to specified path export_path = "C:/DataLink/imports/character/character.fbx" exported_paths = export.do_export(file_path=export_path) # Export options available: # - option_t_pose: Export in T-pose bind position # - option_bakehair: Bake hair diffuse and specular textures # - option_bakeskin: Bake skin diffuse textures # - option_remove_hidden: Remove hidden mesh faces # - option_hik_data: Export HIK profile for characterization # - option_profile_data: Export facial expression profile # - option_export_sub_level: Subdivision level (-1=current, 0-2=specific) # - option_animation_only: Export motion only without mesh ``` -------------------------------- ### Manage Characters with LinkActor Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Use the LinkActor class to manage CC/iClone objects within DataLink. Find actors by link ID, retrieve actor information, and set templates for pose transfer. ```python from btp import link link_id = "character_123456" actor = link.LinkActor.find_actor( link_id, search_name="MyCharacter", search_type="AVATAR" ) if actor: print(f"Name: {actor.name}") print(f"Type: {actor.get_type()}") print(f"Link ID: {actor.get_link_id()}") print(f"Is Standard: {actor.is_standard()}") skeleton = actor.get_skeleton_component() face = actor.get_face_component() morph = actor.get_morph_component() actor.select() actor.set_template({ "bones": ["CC_Base_Hip", "CC_Base_Spine01", ...], "bone_ids": [12345, 12346, ...], "shapes": ["Jaw_Open", "Eye_L_Look_L", ...], "drivers": "EXPRESSION" }) ``` -------------------------------- ### Access Character Material Data via CCJsonData Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Load and access character material settings, textures, and shader parameters from JSON files accompanying FBX exports. Retrieve generation type, character type, and link ID. ```python from btp import cc json_path = "C:/DataLink/imports/character/character.json" fbx_path = "C:/DataLink/imports/character/character.fbx" character_id = "character" json_data = cc.CCJsonData(json_path, fbx_path, character_id) generation = json_data.get_character_generation() char_type = json_data.get_character_type() link_id = json_data.get_link_id() mat_json = json_data.get_material_json("CC_Base_Body", "Ga_Skin_Body") if mat_json: diffuse_tex = mat_json.get_texture_full_path("Base Color", folder) normal_tex = mat_json.get_texture_full_path("Normal", folder) diffuse_color = mat_json.get_diffuse_color() opacity = mat_json.get_opacity() shader_type = mat_json.get_shader() roughness = mat_json.get_custom_shader_var("Roughness") sss_radius = mat_json.get_sss_var("Radius") ``` -------------------------------- ### Send Actors Over DataLink Source: https://context7.com/soupday/ccic-blender-pipeline-plugin/llms.txt Utilizes the DataLink class to send avatars, props, lights, and cameras to Blender, including full animation and material data. This is a core component of the real-time synchronization feature. ```python from btp import link data_link = link.get_data_link() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.