### Generate Multiple Humans Source: https://context7.com/oliverjpost/humgen3d/llms.txt Generates a specified number of human characters and spaces them out in the scene. Requires the HumanGenerator3D add-on to be installed and initialized. ```python humans = [] for i in range(10): human = generator.generate_human(bpy.context, pose_type="standing") human.location = (i * 2, 0, 0) # Space them out humans.append(human) print(f"Generated {len(humans)} humans") ``` -------------------------------- ### Adjust Human Height with Height Settings Source: https://context7.com/oliverjpost/humgen3d/llms.txt Control the height of the human character using the `human.height` property. This includes getting current height in cm or m, setting specific heights, and randomizing height within a range. ```python from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Get current height print(f"Height: {human.height.centimeters} cm") print(f"Height: {human.height.meters} m") # Set specific height in centimeters human.height.set(180) # 180 cm # Set a tall human human.height.set(195) # Set a shorter human human.height.set(160) # Randomize height (between 150-200 cm) human.height.randomize() ``` -------------------------------- ### Create and Manage Humans with Human Class Source: https://context7.com/oliverjpost/humgen3d/llms.txt Learn how to create humans from presets, access existing ones, retrieve properties, set location and rotation, and delete humans using the `Human` class. ```python import bpy from HumGen3D import Human # Get available preset categories for a gender categories = Human.get_categories("female") # Returns: ['All', 'Casual', 'Business', 'Sports', ...] # Get preset options within a category presets = Human.get_preset_options("female", category="Casual") # Returns list of preset paths like ['models/female/Casual/preset1.jpg', ...] # Create a human from a preset human = Human.from_preset(presets[0]) # Access an existing human in the scene selected_obj = bpy.context.active_object existing_human = Human.from_existing(selected_obj) # Get human properties print(f"Name: {human.name}") print(f"Gender: {human.gender}") print(f"Height: {human.height.centimeters} cm") # Set human location and rotation human.location = (0, 0, 0) human.rotation_euler = (0, 0, 1.57) # Delete the human from the scene human.delete() ``` -------------------------------- ### Load Human Process Settings from Template Source: https://context7.com/oliverjpost/humgen3d/llms.txt Loads processing settings for a human character from a specified template file path. Ensure the `Human` class is imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Load settings from template human.process.set_settings_from_template(template_path) ``` -------------------------------- ### Apply and Manage Poses with Python Source: https://context7.com/oliverjpost/humgen3d/llms.txt Use the human.pose property to apply presets, manipulate Rigify bones, and save custom poses to the library. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Get available pose categories pose_categories = human.pose.get_categories() # Get pose options pose_options = human.pose.get_options(bpy.context) print(f"Available poses: {len(pose_options)}") # Get poses by category standing_poses = human.pose.get_options(bpy.context, category="Standing") # Apply a pose human.pose.set(pose_options[0]) # Reset pose to default human.pose.reset() # Access pose bones for custom manipulation for posebone in human.pose_bones: print(f"Bone: {posebone.name}") # Get specific bone by original name jaw_bone = human.pose.get_posebone_by_original_name("jaw") # Save current pose to library thumbnail = bpy.data.images.get("thumbnail_image") human.pose.save_to_library( name="MyCustomPose", category="Custom", thumbnail=thumbnail ) # Access Rigify settings rigify = human.pose.rigify ``` -------------------------------- ### Control Facial Expressions with Python Source: https://context7.com/oliverjpost/humgen3d/llms.txt Manage facial expressions using 1-click presets or by loading the facial rig for fine-tuned control. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Get available expression categories expression_categories = human.expression.get_categories() # Get expression options expression_options = human.expression.get_options(bpy.context) # Get expressions by category happy_expressions = human.expression.get_options(bpy.context, category="Happy") # Apply a 1-click expression human.expression.set(expression_options[0]) # Set random expression human.expression.set_random(bpy.context) # Access expression shape keys for key in human.expression.keys: print(f"Expression key: {key.name}, value: {key.value}") # Load facial rig for fine control human.expression.load_facial_rig() # Check if facial rig is loaded if human.expression.has_facial_rig: print("Facial rig is active") # Remove facial rig when done human.expression.remove_facial_rig() # Reset all expression shape keys to 0 for key in human.expression.keys: key.value = 0 ``` -------------------------------- ### Add Outfits and Footwear Source: https://context7.com/oliverjpost/humgen3d/llms.txt Manage clothing and footwear for a human character. Requires `bpy` and `HumGen3D` imports, and a `Human` object. Outfits and footwear can be set from options, randomized, and their colors customized. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Get available outfit options outfit_options = human.clothing.outfit.get_options(bpy.context) print(f"Available outfits: {len(outfit_options)}") # Get outfits by category casual_outfits = human.clothing.outfit.get_options(bpy.context, category="Casual") # Set an outfit human.clothing.outfit.set(outfit_options[0]) # Randomize outfit colors for cloth_obj in human.clothing.outfit.objects: human.clothing.outfit.randomize_colors(cloth_obj) human.clothing.outfit.set_texture_resolution(cloth_obj, "medium") # Get available footwear options footwear_options = human.clothing.footwear.get_options(bpy.context) # Set footwear human.clothing.footwear.set(footwear_options[0]) # Set random footwear human.clothing.footwear.set_random(bpy.context) # Customize footwear colors for shoe_obj in human.clothing.footwear.objects: human.clothing.footwear.randomize_colors(shoe_obj) # Get clothing as dictionary (for saving/loading) clothing_data = human.clothing.as_dict() ``` -------------------------------- ### Bake Human Textures Source: https://context7.com/oliverjpost/humgen3d/llms.txt Initiates texture baking for a human character, specifying the output folder and resolution multiplier. The `context` parameter should be `bpy.context`. Verify baking completion using `is_baked()`. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Access baking settings baking = human.process.baking baking.bake_all( folder="/path/to/output", resolution=4, # Resolution multiplier context=bpy.context ) # Check if textures were baked if human.process.baking.is_baked(): print("Textures have been baked") ``` -------------------------------- ### Render Human Thumbnail Source: https://context7.com/oliverjpost/humgen3d/llms.txt Renders a thumbnail image of the human character, specifying the output folder, name, focus area, resolution, and whether to use a white material. Ensure the `Human` class is imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Render a thumbnail of the human thumbnail_path = human.render_thumbnail( folder="/path/to/thumbnails", name="character_preview", focus="full_body_front", # Options: full_body_front, full_body_side, head_front, head_side resolution=512, white_material=False ) ``` -------------------------------- ### Customize and Save Human Preset Source: https://context7.com/oliverjpost/humgen3d/llms.txt Customizes a human character by randomizing body, face, and skin properties, setting height, and then saves it as a new preset in the library with a name, category, and optional thumbnail. Ensure `bpy.data.images` is accessible for thumbnails. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Customize the human human.body.randomize() human.face.randomize() human.skin.randomize() human.height.set(170) # Get human as dictionary (for custom serialization) human_dict = human.as_dict() # Contains: age, keys, skin, eyes, height, hair, clothing # Save human to library as a new preset thumbnail = bpy.data.images.get("my_thumbnail") human.save_to_library( name="MyCustomHuman", category="Custom", thumbnail=thumbnail ) ``` -------------------------------- ### Save Human Process Settings to Template Source: https://context7.com/oliverjpost/humgen3d/llms.txt Saves the current processing settings of a human character to a template file. Specify the folder and template name. Ensure the `Human` class is imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Save process settings to template template_path = human.process.save_settings_to_template( folder="/path/to/templates", template_name="MyProcessTemplate" ) ``` -------------------------------- ### Manage Hair Systems Source: https://context7.com/oliverjpost/humgen3d/llms.txt Control regular hair, eyebrows, eyelashes, and facial hair. Requires `bpy` and `HumGen3D` imports, and a `Human` object. Hair quality and shader type can be adjusted for performance. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Get available hair options hair_options = human.hair.regular_hair.get_options(bpy.context) print(f"Available hairstyles: {hair_options}") # Set a hairstyle from library human.hair.regular_hair.set(hair_options[0]) # Randomize hair human.hair.regular_hair.randomize(bpy.context) # Adjust hair color properties human.hair.regular_hair.lightness.value = 0.3 human.hair.regular_hair.redness.value = 0.2 # Set hair quality (affects performance) human.hair.set_hair_quality("medium") # "high", "medium", "low", "ultralow" # Update hair shader type human.hair.update_hair_shader_type("accurate") # "fast" or "accurate" # Hide/show hair children (for performance during editing) human.hair.children_set_hide(True) # Hide for better performance human.hair.children_set_hide(False) # Show for final render # Eyebrows human.hair.eyebrows.randomize_color() # Facial hair (male only) if human.gender == "male": face_hair_options = human.hair.face_hair.get_options(bpy.context) if face_hair_options: human.hair.face_hair.set(face_hair_options[0]) human.hair.face_hair.randomize(bpy.context) # Access particle systems for ps in human.hair.particle_systems: print(f"Particle system: {ps.name}") # Remove specific hair system human.hair.remove_system_by_name("Hair_System_Name") ``` -------------------------------- ### Height Settings Source: https://context7.com/oliverjpost/humgen3d/llms.txt Control the physical height of the generated human character. ```APIDOC ## Height Settings ### Description Provides methods to set or randomize the height of the human character. ### Methods - **human.height.set(value)**: Sets height in centimeters. - **human.height.randomize()**: Randomizes height within a default range. ### Properties - **centimeters** (float): Height in cm. - **meters** (float): Height in m. ``` -------------------------------- ### Generate Multiple Humans with BatchHumanGenerator Source: https://context7.com/oliverjpost/humgen3d/llms.txt Configure and generate randomized humans programmatically using the BatchHumanGenerator class. ```python import bpy from HumGen3D import BatchHumanGenerator, Human # Create a batch generator with default settings generator = BatchHumanGenerator( add_clothing=True, add_hair=True, add_expression=True ) # Configure generation parameters generator.female_chance = 0.5 generator.male_chance = 0.5 generator.texture_resolution = "medium" # "high", "medium", "low" generator.hair_type = "particle" # "particle" or "haircards" generator.hair_quality = "medium" # "high", "medium", "low", "ultralow" generator.average_height_male = 177 # cm generator.average_height_female = 165 # cm generator.height_one_standard_deviation = 0.05 generator.expression_type = "natural" # "natural" or "most_varied" # Optionally filter by preset categories generator.human_preset_category_chances = { "Casual": 0.6, "Business": 0.3, "Sports": 0.1 } # Optionally filter clothing categories generator.clothing_categories = ["Casual", "Business"] # Generate a single human human = generator.generate_human( context=bpy.context, pose_type="standing" # "a_pose", "t_pose", or pose category name ) ``` -------------------------------- ### Export Humans to 3D Formats Source: https://context7.com/oliverjpost/humgen3d/llms.txt Export models using the human.export property to formats including FBX, OBJ, glTF, and Alembic. ```python from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Export to FBX human.export.to_fbx( filepath="/path/to/output/character.fbx", export_custom_props=False, triangulate=False, axis_forward="-Z", axis_up="Y", primary_bone_axis="Y", secondary_bone_axis="X", use_leaf_bones=True, bake_textures=True # Bake textures before export ) # Export to OBJ human.export.to_obj( filepath="/path/to/output/character.obj", apply_modifiers=True, triangulate=False, export_vertex_groups=False, path_mode="AUTO", axis_forward="-Z", axis_up="Y" ) # Export to glTF (embedded) human.export.to_gltf_embedded( filepath="/path/to/output/character.gltf", bake_textures=True ) # Export to glTF (separate files) human.export.to_gltf_separate( filepath="/path/to/output/character.gltf", bake_textures=True ) # Export to GLB (binary glTF) human.export.to_glb( filepath="/path/to/output/character.glb", bake_textures=True ) # Export to Alembic human.export.to_abc( filepath="/path/to/output/character.abc" ) ``` -------------------------------- ### Human Class - Character Management Source: https://context7.com/oliverjpost/humgen3d/llms.txt The Human class is the primary entry point for creating, accessing, and managing human characters in the scene. ```APIDOC ## Human Class ### Description Provides methods to create humans from presets, access existing scene objects, and manage basic properties like location and deletion. ### Methods - **Human.get_categories(gender)**: Returns available preset categories. - **Human.get_preset_options(gender, category)**: Returns list of preset paths. - **Human.from_preset(path)**: Creates a new human from a preset. - **Human.from_existing(obj)**: Wraps an existing Blender object as a Human. - **human.delete()**: Removes the human from the scene. ### Properties - **name** (string): Name of the human. - **gender** (string): Gender of the human. - **height** (object): Access to height settings. - **location** (tuple): XYZ coordinates. - **rotation_euler** (tuple): Rotation values. ``` -------------------------------- ### Customize Skin Material Properties Source: https://context7.com/oliverjpost/humgen3d/llms.txt Modify skin material properties such as tone, redness, and saturation using the `human.skin` property. Access and print current values for these properties. ```python from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Access skin material properties print(f"Skin tone: {human.skin.tone.value}") print(f"Redness: {human.skin.redness.value}") print(f"Saturation: {human.skin.saturation.value}") ``` -------------------------------- ### Adjust Skin Properties Source: https://context7.com/oliverjpost/humgen3d/llms.txt Modify skin tone, redness, saturation, freckles, splotches, and roughness. Ensure the `Human` object is initialized before use. ```python # Adjust skin properties human.skin.tone.value = 0.5 human.skin.redness.value = 0.3 human.skin.saturation.value = 0.4 human.skin.freckles.value = 0.2 human.skin.splotches.value = 0.1 human.skin.roughness_multiplier.value = 1.0 human.skin.normal_strength.value = 1.0 ``` ```python # Randomize skin appearance human.skin.randomize() ``` ```python # Enable/disable subsurface scattering human.skin.set_subsurface_scattering(True) ``` ```python # Enable/disable underwear overlay human.skin.set_underwear(True) ``` ```python # Change skin texture from library texture_options = human.skin.texture.get_options() human.skin.texture.set(texture_options[0]) ``` ```python # Set texture resolution human.skin.texture.set_resolution("high") # "high", "medium", or "low" ``` ```python # Gender-specific skin settings (male) if human.gender == "male": human.skin.gender_specific.beard_shadow.value = 0.5 human.skin.gender_specific.mustache_shadow.value = 0.3 ``` ```python # Gender-specific skin settings (female - makeup) if human.gender == "female": human.skin.gender_specific.foundation_amount.value = 0.5 human.skin.gender_specific.blush_opacity.value = 0.3 human.skin.gender_specific.lipstick_opacity.value = 0.6 human.skin.gender_specific.eyeliner_opacity.value = 0.4 ``` -------------------------------- ### Check Human Process State Source: https://context7.com/oliverjpost/humgen3d/llms.txt Checks the processing status of a human character, including whether it has been baked, is an LOD model, or has haircards. Ensure the Human class is imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Check process state print(f"Was baked: {human.process.was_baked}") print(f"Is LOD: {human.process.is_lod}") print(f"Has haircards: {human.process.has_haircards}") ``` -------------------------------- ### Align Camera to Human Source: https://context7.com/oliverjpost/humgen3d/llms.txt Adjusts the camera's position and orientation to focus on a specific human character. Requires a `camera` object and the `Human` class to be imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Make camera look at human camera = bpy.data.objects.get("Camera") human.make_camera_look_at_human(camera, look_at_correction=0.9) ``` -------------------------------- ### Body and Face Customization Source: https://context7.com/oliverjpost/humgen3d/llms.txt Methods for adjusting body proportions and facial features using randomization or manual key manipulation. ```APIDOC ## Body and Face Settings ### Description Allows fine-grained control over body and facial shape keys. ### Methods - **human.body.randomize(category)**: Randomizes body proportions. - **human.body.reset_values()**: Resets body to default. - **human.face.randomize(subcategory, use_bell_curve)**: Randomizes facial features. - **human.face.reset()**: Resets face to default. ### Accessing Keys - **human.body.keys**: List of body proportion keys. - **human.face.keys**: List of facial feature keys. ``` -------------------------------- ### Randomize and Adjust Body Proportions Source: https://context7.com/oliverjpost/humgen3d/llms.txt Control body proportions using the `human.body` property. This includes accessing keys, randomizing proportions globally or by category, resetting values, and manually adjusting specific keys. ```python from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Access body proportion keys for key in human.body.keys: print(f"{key.name}: {key.value}") # Randomize body proportions human.body.randomize() # Randomize specific category only human.body.randomize(category="torso") # Reset all body proportions to default human.body.reset_values() # Manually adjust specific body keys for key in human.body.keys: if "shoulder" in key.name.lower(): key.value = 0.5 # Range typically -1 to 1 ``` -------------------------------- ### Customize Eye Appearance Source: https://context7.com/oliverjpost/humgen3d/llms.txt Control iris and sclera colors, and randomize eye appearance. Requires importing the `Human` class and initializing a `Human` object. ```python from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Get eye materials inner_mat = human.eyes.inner_material outer_mat = human.eyes.outer_material # Access eye color print(f"Iris color: {human.eyes.iris_color.value}") print(f"Sclera color: {human.eyes.sclera_color.value}") # Set custom iris color (RGBA tuple) human.eyes.iris_color.value = (0.1, 0.3, 0.6, 1.0) # Blue eyes # Set sclera color human.eyes.sclera_color.value = (1.0, 1.0, 1.0, 1.0) # White # Randomize eye color based on worldwide statistics human.eyes.randomize() # Get eye settings as dictionary eye_data = human.eyes.as_dict() # Returns: {'pupil_color': (r, g, b, a), 'sclera_color': (r, g, b, a)} ``` -------------------------------- ### Manipulate Facial Features with Face Settings Source: https://context7.com/oliverjpost/humgen3d/llms.txt Customize facial features using the `human.face` property. This allows access to face keys, randomization of all or specific subcategories, bell curve randomization, resetting features, and manual adjustments. ```python from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Access facial proportion keys face_keys = human.face.keys for key in face_keys: print(f"{key.name} [{key.subcategory}]: {key.value}") # Randomize all facial features human.face.randomize() # Randomize with bell curve distribution (softer randomization) human.face.randomize(use_bell_curve=True) # Randomize specific subcategory human.face.randomize(subcategory="nose") # Reset facial features to default human.face.reset() # Manually set specific face keys for key in human.face.keys: if "nose_width" in key.name.lower(): key.value = 0.3 ``` -------------------------------- ### Duplicate and Manipulate Human Source: https://context7.com/oliverjpost/humgen3d/llms.txt Duplicates an existing human character, sets its location, and allows for hiding or showing the character. Ensure the `Human` class is imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("female")[0]) # Duplicate the human human_copy = human.duplicate() human_copy.location = (2, 0, 0) # Hide/show the human human.hide_set(True) # Hide human.hide_set(False) # Show ``` -------------------------------- ### Rename Human Bones Source: https://context7.com/oliverjpost/humgen3d/llms.txt Renames bones of a human character using a JSON string that maps old bone names or suffixes to new ones. Ensure the `Human` class is imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Rename bones using JSON mapping bone_mapping = ''' { "suffix_L": "_L", "suffix_R": "_R", "spine": "Spine", "head": "Head", "hand": "Hand" } ''' human.process.rename_bones_from_json(json_string=bone_mapping) ``` -------------------------------- ### Rename Human Objects Source: https://context7.com/oliverjpost/humgen3d/llms.txt Renames objects associated with a human character using a JSON string for mapping. Custom tokens and suffixes can be applied. Ensure the `Human` class is imported. ```python import bpy from HumGen3D import Human human = Human.from_preset(Human.get_preset_options("male")[0]) # Rename objects using JSON mapping object_mapping = ''' { "body": "{name}_Body", "eyes": "{name}_Eyes", "clothing": "{name}_Clothing_{original_name}" } ''' human.process.rename_objects_from_json( json_string=object_mapping, custom_token="Character01", suffix="_v1" ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.