mapmap icon indicating copy to clipboard operation
mapmap copied to clipboard

OSC message to change a color property fails

Open aalex opened this issue 5 years ago • 7 comments

OSC message to change a color property fails.

Expected Behavior

We should be able to change a color property with a string argument such as "#ffcc33" for orange.

Actual Behavior

There is an error message in the console and it doesn't work.

Steps to Reproduce the Problem

  1. apt-get install liblo-tools
  2. Launch MapMap and open the project attached
  3. oscsend localhost 12345 /mapmap/paint/color is 0 "#ffcc33"

Specifications

  • Version: dev (soon to be 0.7)
  • Platform: Ubuntu 19.10

Error message

avr. 01 20 20:38 | Debug: C++OscReceiver Received: "/mapmap/paint/color" (QVariant(int, 0), QVariant(QString, "ffcc33")) - src/control/qosc/oscreceiver.cpp:24
avr. 01 20 20:38 | Debug: Attempt to set a paint property "color" QVariant(QString, "#ffcc33") - src/control/OscInterface.cpp:215
avr. 01 20 20:38 | Debug: Path could not be processed: "/mapmap/paint/color" - src/control/OscInterface.cpp:273
avr. 01 20 20:38 | Debug: "/mapmap/paint/color" - src/control/OscInterface.cpp:139
avr. 01 20 20:38 | Debug: "is" - src/control/OscInterface.cpp:139
avr. 01 20 20:38 | Debug: 0 - src/control/OscInterface.cpp:131
avr. 01 20 20:38 | Debug: "#ffcc33" - src/control/OscInterface.cpp:139
avr. 01 20 20:38 | Debug: - src/control/OscInterface.cpp:146

aalex avatar Apr 02 '20 00:04 aalex

here is the example project. (a simple triangle that is pink)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapmap>
<project version="0.6.3">
  <paints>
    <paint className="Color" name="#cc49ff" locked="false" id="1">
      <opacity>1</opacity>
      <color>#cc49ff</color>
    </paint>
  </paints>
  <mappings>
    <mapping className="ColorMapping" name="Triangle 1" visible="true" locked="false" paintId="1" depth="1" id="1" solo="false">
      <opacity>1</opacity>
      <destination className="Triangle">
        <locked>false</locked>
        <vertices>
          <vertex y="223" x="265"/>
          <vertex y="223" x="795"/>
          <vertex y="74" x="530"/>
        </vertices>
      </destination>
    </mapping>
  </mappings>
</project>

aalex avatar Apr 02 '20 00:04 aalex

The error message should be more explicit - did it fail at setting the property or at finding the object to alter?

aalex avatar Apr 02 '20 14:04 aalex

Try

oscsend localhost 12345 /mapmap/paint/color is 1 "#ffcc33"

sofian avatar Apr 02 '20 14:04 sofian

(I just tested it)

sofian avatar Apr 02 '20 14:04 sofian

However: the color of the paint seems to change but it is not updated properly in the property manager...

sofian avatar Apr 02 '20 14:04 sofian

@aalex Did you try: oscsend localhost 12345 /mapmap/paint/color is 1 "#ffcc33"

sofian avatar Apr 14 '20 17:04 sofian

I did, but I remember it wasn't working either. It works for you? I will try again soon. @sofian

aalex avatar Apr 14 '20 17:04 aalex