Delicode / NI-mate-plugins

This repository holds the plugins for NI mate.
http://www.ni-mate.com
17 stars 7 forks source link

A few updates to the 2.8 code #11

Closed plachenko closed 3 years ago

plachenko commented 3 years ago

When the first 2.8 implementation came about there was no set way of creating and manipulating collections. I've revised the code to include an 'NIMate' collection on start so that the plugin doesn't pollute the default scene collection with objects.

This update also removes all the objects on start so that if the user switches types they don't have to delete the created objects manually first.

I also deleted an unused reference that was being called when the plugin was being removed-- seems like it was still from the BGE implementation.

A few notes: There might be some changes that happen to the blender python api during the 3.0 transition: https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Python_API

It seems like they're changing 'wiki_url' to 'doc_url' in bl_info. Not sure what else to look out for but that might be something to implement in the future.

plachenko commented 3 years ago

One thing this patch is missing is keeping any constraint/modifier references on start-- I'm not sure of an elegant way of maintaining those connections when switching object type.

I can add a check for current object type that doesn't delete all objects within the collection on start if it's the same object used. That wouldn't be the best solution, however, because changing object types would delete the references. It would be best if we could keep those references somewhere and relink them when restarting the plugin. The only thing I can think of is keeping empties around by default and referencing those while deleting the other objects.

I would keep this PR open until that change is in.

plachenko commented 3 years ago

I opted to add a Boolean property to lock the collection hierarchy to keep it from deleting all the objects within the collection. This will help keep object references with any constraints and by default it's set to true. If unset it will delete and refresh the hierarchy with new objects.

I also exposed the IP into the user interface. This should close issue #4 since the user can set the IP address to 0.0.0.0 instead which allows you to send OSC data over a network rather than locking you to local host.

SirDifferential commented 3 years ago

Thanks for the updates. I merged the changes and updated the plugin on the NI mate website.

plachenko commented 3 years ago

Thank you!