Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender 3.3's hair system has a curves data type, so BlendLoader.py needs to update it's valid_object_types list. #1050

Closed
sagoyal2 opened this issue Jan 24, 2024 · 2 comments · Fixed by #1052
Labels
bug Something isn't working first answer provided

Comments

@sagoyal2
Copy link
Contributor

sagoyal2 commented Jan 24, 2024

Describe the issue

Problem
Currently BlenderProc is to be unable to load hair curve entities from a blend file into a new BlenderProc session using the load_blend function in BlenderLoader.py..

Solution
That is because in line 104 valid_object_types is not defined correctly, it should also have a curves in the list.

Reason:
Since Blender 3.3 added its new hair system, there are both curve and curves objects. The former can be added by simply opening Blender and going to Add > Curve > Bezier while the later is created by selecting an object (like the default cube) and then going to Add > Curve > Empty Hair. These two objects are quite different as the curves object can take advantage of the hair geometry nodes and modeling system available.

Anyways, following the documentation available here and here, that means that name for the data block is hair_curves the name for the object type is curves.

The documentation for the param data_blocks should also include hair_curves

Minimal code example

No response

Files required to run the code

No response

Expected behavior

I tested the above changes and adding curves to the valid_object_types list is now able to load hair curves into a new BlenderProc session.

Here is how I'm calling the function:

bproc.loader.load_blend(
    \path\to\blendfile, 
    obj_types = ["mesh", "curves", "hair"],
    data_blocks=["objects", "hair_curves"]
)

BlenderProc version

v2.6.2

@sagoyal2 sagoyal2 added the question Question, not yet a bug ;) label Jan 24, 2024
@sagoyal2 sagoyal2 changed the title Blender 3.5's hair system has a curves data type, so BlendLoader.py needs to update it's valid_object_types list. Blender 3.3's hair system has a curves data type, so BlendLoader.py needs to update it's valid_object_types list. Jan 24, 2024
@cornerfarmer
Copy link
Member

Hey @sagoyal2,

thanks for the nice issue report! I think you are right. We have not encountered this bug, as we did not yet use the hair system.
Would you like to create a PR?

@cornerfarmer cornerfarmer added bug Something isn't working first answer provided and removed question Question, not yet a bug ;) labels Jan 25, 2024
sagoyal2 added a commit to sagoyal2/BlenderProc that referenced this issue Jan 25, 2024
fix(blendloader): add hair_curves support in blendloader

valid_object_types is not defined correctly, it should also have a curves in the list since as of Blender 3.3 it differentiatesbetween curve and curves depending on the new hair system. See: DLR-RM#1050 for more details.

closes DLR-RM#1050
@schirrmacher
Copy link

schirrmacher commented Jun 15, 2024

I still had issues with this (Blender 3.5), I did the following:

objs = bproc.loader.load_blend(
    args.scene,
    obj_types=[
        "mesh",
        "curve",
        "curves",
        "hair",
        "armature",
        "empty",
        "light",
        "camera",
    ],
    data_blocks=[
        "armatures",
        "cameras",
        "curves",
        "hair_curves",
        "images",
        "lights",
        "materials",
        "meshes",
        "objects",
        "textures",
    ],
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working first answer provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants