morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
355 stars 156 forks source link

Python modules are removed #781

Open nicolaje opened 6 years ago

nicolaje commented 6 years ago

Following the issue reported by David Battle in https://sympa.laas.fr/sympa/arc/morse-users/2018-01/msg00013.html

It seems python modules are removed from Blender objects in MORSE.

Minimal builder file to reproduce the issue:

See attached simulation environment from david on the mailing list.

Todo:


battledj commented 6 years ago

Currently looking at the following areas for potential issues:

builder/abstractcomponent.py: if not 'component_config.py' in bpymorse.get_texts().keys(): builder/environment.py: if not 'multinode_config.py' in bpymorse.get_texts().keys(): builder/bpymorse.py: texts_before = set(get_texts()) builder/bpymorse.py: texts_after = set(get_texts()) builder/bpymorse.py: return (texts_before ^ texts_after).pop() builder/bpymorse.py:def get_texts(): builder/bpymorse.py: return bpy.data.texts builder/bpymorse.py: if bpy and bpy.data.texts: builder/bpymorse.py: return bpy.data.texts[name_or_id]

nicolaje commented 6 years ago

Hi David @battledj ,

after a bit of digging, this is a Blender bug: when appending a Blender object from an external file (see https://github.com/morse-simulator/morse/blob/a64dcec89931304c93ac0b18cbe1ec8f211619b7/src/morse/builder/abstractcomponent.py#L650 and https://github.com/morse-simulator/morse/blob/a64dcec89931304c93ac0b18cbe1ec8f211619b7/src/morse/builder/abstractcomponent.py#L714 in morse/src/morse/builder/abstractcomponent.py), only the Python scripts attached to the object are also imported, not the modules.

I have opened an issue on the Blender bug tracker: https://developer.blender.org/T53960

and I prefer to wait for their input before implementing a MORSE specific fix.

The procedure to reproduce the bug outside of the MORSE scope is detailed in the bug report.

battledj commented 6 years ago

That's some good detective work Jeremy. I saw no evidence of a Morse issue either. I'd be very interested in the feedback when you receive it.

Cheers,

David.

On 31/01/18 22:20, Jeremy Nicola wrote:

Hi David @battledj https://github.com/battledj ,

after a bit of digging, this is a Blender bug: when appending a Blender object from an external file (see https://github.com/morse-simulator/morse/blob/a64dcec89931304c93ac0b18cbe1ec8f211619b7/src/morse/builder/abstractcomponent.py#L650 and https://github.com/morse-simulator/morse/blob/a64dcec89931304c93ac0b18cbe1ec8f211619b7/src/morse/builder/abstractcomponent.py#L714 in morse/src/morse/builder/abstractcomponent.py), only the Python scripts attached to the object are also imported, not the modules.

I have opened an issue on the Blender bug tracker: https://developer.blender.org/T53960

and I prefer to wait for their input before implementing a MORSE specific fix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/morse-simulator/morse/issues/781#issuecomment-361902845, or mute the thread https://github.com/notifications/unsubscribe-auth/AiMSzVioU8WafTlLCZGOTN1yDJhrHd7Xks5tQExwgaJpZM4RujsW.

nicolaje commented 6 years ago

So, according to the Blender developpers it is not a bug, but a feature :) https://developer.blender.org/T53960

So we'll go the MORSE specific patch way.

battledj commented 6 years ago

On 01/02/18 20:22, Jeremy Nicola wrote:

So, according to the Blender developpers it is not a bug, but a feature :) https://developer.blender.org/T53960

So we'll go the MORSE specific patch way.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/morse-simulator/morse/issues/781#issuecomment-362206625, or mute the thread https://github.com/notifications/unsubscribe-auth/AiMSzfuLnWv1wxctkxBy5vCsZ80kclLXks5tQYJFgaJpZM4RujsW.

That's a bit unfortunate. I can't see how that could be construed as a feature.