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

Fix the bad (NoneType) parent object errors #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kkaja123
Copy link

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.

…oneType

* This may be a bug due to the way Blender 2.8 changed the scene collections
@@ -16,7 +16,7 @@ def build_importedVectorField(tempvelList, tempOffset):
for i in range(len(tempvelList)):
volmesh.custom_vectorfield[i].vvelocity = tempvelList[i]

volmesh.parent.location = volmesh.parent.location + tempOffset
volmesh.location = volmesh.location + tempOffset
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never tried any of the build_importedVectorField stuff, but I assume that it is going to have the same issue.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I just tried it out with and without the above changes. From what I can tell, this should stay as volmesh.parent.location. With the changes, I'm pretty sure that any offset is ignored and the imported volume is created at the origin.

@isathar
Copy link
Owner

isathar commented Nov 26, 2019

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
Copy link
Author

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
Copy link
Author

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

@isathar
Copy link
Owner

isathar commented Dec 15, 2019

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants