-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: master
Are you sure you want to change the base?
Fix the bad (NoneType) parent object errors #16
Conversation
…oneType * This may be a bug due to the way Blender 2.8 changed the scene collections
FGA_VectorFields/vf_io.py
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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? |
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. |
@isathar Have you had a chance to see if this PR is ready to merge? |
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). |
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.