Skip to content

Commit

Permalink
hotfix 207: unskinned dforce hair
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbui78 committed Jun 14, 2024
1 parent c5daa65 commit 525b92f
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,33 @@ def import_one(self, fbx_adr):
pose.restore_pose() # Run when no animation exists.


# DB 2024-06-14: work-around for dForce hair
if dtu.dtu_dict["dForce"] is not None:
dforce_data = dtu.dtu_dict["dForce"]
for dforce_obj in dforce_data:
if dforce_obj is not None:
obj_name = dforce_obj["Asset Name"]
if obj_name is not None:
obj = bpy.data.objects.get(obj_name + ".Shape")
if obj is not None:
# get DForce-Modifiers
has_dforce_hairs = False
if dforce_obj["DForce-Modifiers"] is not None:
for dforce_modifier in dforce_obj["DForce-Modifiers"]:
if dforce_modifier is not None:
modifier_class = dforce_modifier["Modifier Class"]
if modifier_class is not None and "dforcehair" in modifier_class.lower():
has_dforce_hairs = True
break
if has_dforce_hairs:
# check for vertex groups
if len(obj.vertex_groups) == 0:
# create vertex group
obj.vertex_groups.new(name="head")
# assign all vertices to the vertex group
for v in obj.data.vertices:
obj.vertex_groups[0].add([v.index], 1.0, "REPLACE")

if bpy.context.window_manager.morph_prefix:
bpy.ops.rename.morphs('EXEC_DEFAULT')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bl_info = {
"name": "DazToBlender",
"author": "Daz 3D | https://www.daz3d.com",
"version": (2023, 1, 1, 16),
"version": (2023, 1, 1, 17),
"blender": (2, 80, 0),
"location": "3DView > ToolShelf",
"description": "Daz 3D transfer to Blender",
Expand Down
Binary file modified DazStudioPlugin/DzBlenderBridge.aps
Binary file not shown.
Binary file modified DazStudioPlugin/DzBlenderBridge.rc
Binary file not shown.
Binary file modified DazStudioPlugin/Resources/blenderplugin.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion DazStudioPlugin/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#define PLUGIN_MAJOR 2023
#define PLUGIN_MINOR 1
#define PLUGIN_REV 1
#define PLUGIN_BUILD 16
#define PLUGIN_BUILD 17

#define PLUGIN_VERSION DZ_MAKE_VERSION( PLUGIN_MAJOR, PLUGIN_MINOR, PLUGIN_REV, PLUGIN_BUILD )
2 changes: 1 addition & 1 deletion dzbridge-common

0 comments on commit 525b92f

Please sign in to comment.