NAP 0.3.0 Released


#1

Hi!

We released NAP 0.3.0 last week. This is a major release that contains many bug fixes (as mentioned on the forum), new features and improvements.

Both the source code repository and package downloads have been updated. A more detailed mail that highlights some of it’s new functionality will be shared next week. The entire package has been battle tested, so hopefully switching to 0.3.0 won’t be an issue. If there is anything we can do to answer questions let us know!

I’d like to thank all the people that reported bugs, possible improvements and shared repro cases with us. Many of them have been addressed and solved.

Release Notes - NAP - Version 0.3.0 (in a nutshell)

New Feature
* [NAP-23] - Instance Property Editing (NAPKIN)
* [NAP-280] - API Application Interface (MOD_NAPAPI)
* [NAP-281] - SQLite Database Support (MOD_NAPDATABASE)
* [NAP-285] - Support for Vector of Component Pointers (CORE)
* [NAP-290] - Saving and loading of Parameters (MOD_NAPPARAMETER)
* [NAP-293] - Websocket Support (MOD_NAPWEBSOCKET)
* [NAP-294] - Serial Support (MOD_NAPSERIAL)
* [NAP-304] - Websocket API support (MOD_NAPAPIWEBSOCKET)
* [NAP-310] - 3D Box Mesh (RENDERING)
* [NAP-312] - Support for GLSL uniform arrays and structs in JSON and Runtime (RENDERING)
* [NAP-313] - Support for multiple Python script instances (PYTHON)
* [NAP-314] - Python script demo (DEMO)
* [NAP-319] - Websocket server demo (DEMO)
* [NAP-321] - Rendering of Parameters to screen automatically (MOD_NAPPARAMETERGUI)

Improvement
* [NAP-69] - Don’t build projects during packaging (BUILD)
* [NAP-275] - CurvePanel: Frame selected/zoom to fit button (NAPKIN)
* [NAP-279] - Add UUID to newly created objects (NAPKIN)
* [NAP-283] - Implement deprecation tagging (CORE)
* [NAP-284] - Update Legal to Reflect changes NAP 0.3 release (DOCS)
* [NAP-297] - Raw-pointer support resource manager (CORE)
* [NAP-303] - Make component dependencies optional (CORE)
* [NAP-305] - Default layout + theme (NAPKIN)
* [NAP-311] - Update lineblend demo to use parameters (DEMO)
* [NAP-318] - Show project name in header (NAPKIN)
* [NAP-320] - Fix all broken links and references documentation (DOCS)
* [NAP-322] - CopyStamp demo uses array of lights (struct) GLSL (DEMO)
* [NAP-323] - Fixed render glitches (NAPKIN)

Bug
* [NAP-67] - Updating project.json doesn’t change module includes until next build (CMAKE)
* [NAP-257] - Pointing to a component that’s not part of an other entity results in a wrong path (CORE)
* [NAP-269] - Can’t add elements to vector of short or vector of enum (NAPKIN)
* [NAP-270] - EntityPtr Broken (NAPKIN)
* [NAP-286] - Unit Test Datamodel OSX fails (BUILD)
* [NAP-287] - Ensure unsupported cameras are skipped when rendering entire scene (RENDERING)
* [NAP-288] - Fixed Hotloading Issue - Component/EntityPtrs are always marked as dirty (CORE)
* [NAP-291] - Overriding ResourcePtr in std::vector<ResourcePtr> results in similar ID (NAPKIN)
* [NAP-292] - Closing Napkin (win64) results in pybind error (NAPKIN)
* [NAP-295] - Napkin File load / reload crash (NAPKIN)
* [NAP-296] - Inspector panel looses focus (NAPKIN)
* [NAP-298] - Renaming resource blanks out inspector panel (NAPKIN)
* [NAP-299] - Fix order of destruction (CORE)
* [NAP-300] - Devices should be stopped before being destructed (CORE)
* [NAP-301] - Deserialization not thread safe (CORE)
* [NAP-302] - getDependentComponents takes into account all components of the dependent type (CORE)
* [NAP-306] - ‘new’ filename extension issue on OSX (NAPKIN)
* [NAP-307] - Drag&drop bug in list of collapsed elements (NAPKIN)
* [NAP-308] - changing embedded object id changes / updates inspector view (NAPKIN)
* [NAP-309] - Wrong include paths in documentation (DOCS)
* [NAP-315] - ComponentPtrs not updated after Component rename (NAPKIN)
* [NAP-316] - Embedded resource pointers not working (NAPKIN)
* [NAP-317] - Child objects of graph reappear after deleting graph (NAPKIN)
* [NAP-324] - Fixed render glitches (NAPKIN)
* [NAP-325] - Ubuntu 19.04 Python Link Error (BUILD)

Breaking Changes

The RenderService::destroyGLContextResources() now takes an array of pointers instead of an array of nap::ResourcePtr. The following:

> // Clear opengl context related resources that are not necessary any more
> mRenderService->destroyGLContextResources({ mRenderWindow });

is now:

> // Clear opengl context related resources that are not necessary any more
> mRenderService->destroyGLContextResources({ mRenderWindow.get() });

Raw resource pointers are not supported as a property anymore. Use the nap::ResourcePtr<T> instead. Example:

nap::Video* mVideo

becomes:

nap::ResourcePtr<Video> mVideo

On MacOS the currently supported version of XCode is bumped to 10.3 and the recommended operating system is Mojave.

License Policy Change

Note that from NAP 0.3.0 the licensing terms have changed. In a nuthsell: non commercial use of NAP is completely free, when using NAP commercially a license is required. This license is tied to the product, not the individual. It is difficult for us to maintain the current rate of development without charging a small fee when using NAP commercially. This only applies to the package and excludes customers with a source code agreement.

NAP 0.2.3 can still be used for commercial and non-commercial projects but is not actively supported anymore.


#2

I upgraded a project from 0.2.3 to 0.3 and although most things are working, I am having an issue loading an existing JSON file. The file saves just fine in Napkin, but when the application is launched it quits on startup with:

[fatal] error: unable to initialize application:
        Failed to load and deserialize randomlightgrid.json
        Encountered a raw pointer property {VideoItemResource_9959c5a4}:Video while only pointers like ObjectPtr are supported.

I believe the relevant entry in the JSON is the following component:

{
            "Type": "nap::Entity",
            "mID": "Video",
            "Components": [
                {
                    "Type": "nap::SelectVideoComponent",
                    "mID": "nap::SelectVideoComponent",
                    "Videos": [
                        {
                            "Type": "nap::VideoItemResource",
                            "mID": "VideoItemResource_9959c5a4",
                            "Video": "Video_Clouds",
                            "Temperature": 0.5,
                            "Speed": 1.0,
                            "Brightness": 0.0,
                            "Contrast": 1.0,
                            "Flip H": false,
                            "Flip V": false,
                            "Invert": false,
                            "OSC Output Address": ""
                        },
                        {
                            "Type": "nap::VideoItemResource",
                            "mID": "VideoItemResource_7355a947",
                            "Video": "Video_Raindrop_Ripples",
                            "Temperature": 0.5,
                            "Speed": 1.0,
                            "Brightness": 0.0,
                            "Contrast": 1.0,
                            "Flip H": false,
                            "Flip V": false,
                            "Invert": false,
                            "OSC Output Address": ""
                        }
                    ],
                    "Index": 0
                },

Any idea what needs to be changed to make this keep working?

The Component itself has this property:

std::vector<ResourcePtr<VideoItemResource>> mVideoItems;  

I think this relates to the feature [NAP-285] above but I could be wrong.


#3

Ah, wait nevermind.

Changing a raw pointer (here, nap::Video*) into a Resource Pointer solved the problem. As helpfully suggested in the error message itself. So this now works:

ResourcePtr<Video> mVideo;

I’m still curious why this was valid in NAP 0.2.3 and not 0.3 ? Presumably for a good reason, but perhaps it needs to be highlighted as a breaking change?


#4

This change is related to the de-serialization of resources on another thread. We had to add support for raw-resource pointers that can’t be changed under the hood. This is used when an api message is received and turned into NAP resources on the receiving thread. That required us to remove the raw-pointer as a property because otherwise we wouldn’t be able to distinguish the two.

But I agree, this should be noted in the release notes!