mgear-dev / mgear4

mGear v.4.x.x (python 3 ready) https://mgear4.readthedocs.io
MIT License
264 stars 93 forks source link

anim_picker: Reading data file which uses ANIM_PICKER_PATH token is not working #210

Open mattschwarzAnim opened 1 year ago

mattschwarzAnim commented 1 year ago

The PICKER_DATA node which you can see in the pictures doesn´t return any error. However, the picker window is empty as it returns no data: image

The problem seems to be two different issues:

  1. No token conversion is currently happening on the path.exists check. https://github.com/mgear-dev/mgear4/blob/f6046994b586395c067a0dd3c6c13d31a240123f/release/scripts/mgear/anim_picker/picker_node.py#L264

As a quick test I used the protected method to add the conversion: if not os.path.exists(file_handlers._convert_path_token(file_path)):

  1. The @convert_path_token decorator does not seems to work if the file_path variable is passed as a arg. https://github.com/mgear-dev/mgear4/blob/f6046994b586395c067a0dd3c6c13d31a240123f/release/scripts/mgear/anim_picker/picker_node.py#L267

When I pass it as a kwarg it returns the expected result return file_handlers.read_data_file(file_path=file_path)

miquelcampos commented 1 year ago

Hi @mattschwarzAnim Thanks for reporting this. I have added to the current WIP project and I will check it ASAP :)