isathar / Blender_UE4_VectorFieldEditor

Blender addon that adds support for working with 3D vector fields using the FGA file format.
177 stars 39 forks source link

Fix the bad (NoneType) parent object errors #16

Open kkaja123 opened 4 years ago

kkaja123 commented 4 years ago

Remove the upwards scoping to the object's parent since it has been NoneType.

This may be a bug due to the way Blender 2.8 changed the scene collections.

Fixes issue #15.

isathar commented 4 years ago

Thanks for looking into this! Sorry about the radio silence, I haven't been keeping up with my notifications recently.

Does your last post mean your changes cause the offset to be ignored when importing vector fields and I shouldn't merge them, or am I misunderstanding?

kkaja123 commented 4 years ago

At first, I applied the change to the import offset. After some quick testing, I found that the offset was ignored. I made a second commit that removed the change so the offset would be used again.

From my very basic testing, the code in the pull request works. You should make sure that things are working properly, because I have very little experience with this add-on.

kkaja123 commented 4 years ago

@isathar Have you had a chance to see if this PR is ready to merge?

isathar commented 4 years ago

After some testing, I ended up adding a check for volmesh.parent, instead. The parent it refers to is the surrounding wireframe shape that represents the bounds. Since the volume containing the particles is parented to it, setting its location to the imported offset won't do anything, so I added a check for the parent mesh, instead. The offset will now only be set if the parent is found, which should resolve the noneType error messages.

I'll update the current release after some more testing. I've also moved the UI panel to the panels on the right of the workspace, which seems like a much better spot for it (thanks to matanshukry for including it in the suggestion for the flowmap editor).