Giter VIP home page Giter VIP logo

Comments (9)

sojamo avatar sojamo commented on September 7, 2024 1

Hi, sorry for not following up earlier. the default properties format changed from .ser to JSON. Do add the following line after you have created an instance of ControlP5 to set the properties format to .ser

cp5.getProperties().setFormat(ControlP5.SERIALIZED);

from controlp5.

potential-difference avatar potential-difference commented on September 7, 2024 1

Likewise - was having huge issues with radiobuttons and dropdown lists, serialized has solved this super simply!!

from controlp5.

w4nderlust avatar w4nderlust commented on September 7, 2024

Any news about this Andreas? Can I help you in any way, maybe trying to isolate the problem more?

from controlp5.

w4nderlust avatar w4nderlust commented on September 7, 2024

Your suggestion actually solved my problem, but didn't solve the problem in general.
The point is: I don't care about saving in .ser or .json as long as it works.
Right now (you can see my last push in the repo) adding your suggestion right after initializing the cp5 object worked well, and now I can save and load in .ser without problems.
But without it, after updating to Processing 3.0.1 saving and loading in .json, the controls are not updated correctly and I get the following error:

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at processing.core.PApplet.selectCallback(PApplet.java:6443)
    at processing.core.PApplet.access$0(PApplet.java:6436)
    at processing.core.PApplet$3.run(PApplet.java:6348)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NullPointerException
    at controlP5.ControlP5.invoke(Unknown Source)
    at controlP5.ControllerProperties$JSONFormat.load(Unknown Source)
    at controlP5.ControllerProperties.load(Unknown Source)
    at controlP5.ControlP5.loadProperties(Unknown Source)
    at SkolpTiles.load_callback(SkolpTiles.java:1210)
    ... 21 more

You may try yourself cloning my repository and commenting line 93 and changing line 1191 to:

  if (selection != null) {

from controlp5.

sojamo avatar sojamo commented on September 7, 2024

if the serialized format works for you, why not stick to it? I am aware of the error thrown when saving in JSON. Arrays are not saved properly, this affects for example the properties of a range and saves its values wrongly. I am aware of this bug and will attend to it.

from controlp5.

w4nderlust avatar w4nderlust commented on September 7, 2024

I will stick to it :) just pointing out that, even if my issue is solved there's still a bug somewhere. Thanks for your help anyway!

from controlp5.

kroeder avatar kroeder commented on September 7, 2024

Are there any updates regarding this issue?

from controlp5.

sojamo avatar sojamo commented on September 7, 2024

no updates yet.

from controlp5.

jshaw avatar jshaw commented on September 7, 2024

Thanks, @sojamo for suggesting switching the format to serialized, helped get my group controllers loading as needed!

from controlp5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.