From 8370a5b99a90918df15ae72d7c94427a7f522385 Mon Sep 17 00:00:00 2001 From: Philip Lamb Date: Thu, 23 Mar 2023 18:37:09 +1300 Subject: [PATCH] Add support for multi-marker tracking to 2D tracker. --- Source/Extras/artoolkitx | 2 +- .../Example Scenes/2DScene.unity | 413 +++++++++--------- .../artoolkitX-Unity/Scripts/ARController.cs | 24 + .../Scripts/Editor/ARControllerEditor.cs | 81 ++-- .../Scripts/Editor/ARToolKitMenuEditor.cs | 4 +- .../Scripts/IPluginFunctions.cs | 2 + .../Scripts/PluginFunctionsARX.cs | 17 +- .../ProjectSettings/ProjectSettings.asset | 2 +- artoolkitx-version.txt | 2 +- 9 files changed, 306 insertions(+), 241 deletions(-) diff --git a/Source/Extras/artoolkitx b/Source/Extras/artoolkitx index 0468e73..8eaae1b 160000 --- a/Source/Extras/artoolkitx +++ b/Source/Extras/artoolkitx @@ -1 +1 @@ -Subproject commit 0468e7354a37c91079fb9b8775352e7180e8a82a +Subproject commit 8eaae1bbae28d8875649a869175500d8fcf3ee06 diff --git a/Source/Package/Assets/artoolkitX-Unity/Example Scenes/2DScene.unity b/Source/Package/Assets/artoolkitX-Unity/Example Scenes/2DScene.unity index 75227da..61979e6 100644 --- a/Source/Package/Assets/artoolkitX-Unity/Example Scenes/2DScene.unity +++ b/Source/Package/Assets/artoolkitX-Unity/Example Scenes/2DScene.unity @@ -592,6 +592,7 @@ MonoBehaviour: currentImageProcMode: 0 currentUseVideoBackground: 1 currentNFTMultiMode: 0 + currentTwoDMaxMarkersToTrack: 2 currentLogLevel: 1 scrollPosition: {x: 0, y: 0} --- !u!4 &1192976671 @@ -661,11 +662,11 @@ MonoBehaviour: 240 240 240 240 240 240 240 240 240 240 240 240\n 228 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240\n 225 156 240 240 182 212 225 180 240 240 240 240 240 240 240 240\n 150 116 238 228 66 205 115 151 238 236 225 240 240 - 180 226 240\n 156 84 186 211 47 184 109 170 200 92 30 240 120 50 53 216\n - 147 83 51 73 50 184 106 110 148 17 151 150 45 217 186 85\n127 98 219 - 219 58 179 109 101 128 107 237 125 155 240 163 72\n 155 86 240 240 76 201 - 85 108 121 95 232 137 51 118 153 155\n 149 189 240 240 98 220 141 154 206 - 178 235 230 152 77 175 209\n\n 232 228 239 240 240 240 240 240 240 240 240 207 + 180 226 240\n 156 84 186 211 47 184 109 170 200 92 30 240 120 50 53 216\n147 + 83 51 73 50 184 106 110 148 17 151 150 45 217 186 85\n127 98 219 219 + 58 179 109 101 128 107 237 125 155 240 163 72\n 155 86 240 240 76 201 85 + 108 121 95 232 137 51 118 153 155\n 149 189 240 240 98 220 141 154 206 178 + 235 230 152 77 175 209\n\n 232 228 239 240 240 240 240 240 240 240 240 207 83 64 155 209\n 240 240 240 240 240 240 240 240 240 240 226 53 186 161 161 175\n 240 240 240 240 240 240 240 240 240 240 180 50 217 232 119 77\n240 240 240 240 240 240 240 240 240 238 237 120 45 155 51 152\n238 240 240 240 240 @@ -677,84 +678,84 @@ MonoBehaviour: 240 240 240 240 240 216 208 187 184 180 210 219\n 240 240 240 240 240 240 240 240 240 186 75 62 53 58 76 98\n 233 240 240 240 240 240 240 240 240 240 231 213 78 222 240 240\n 240 240 240 240 240 240 240 240 240 240 238 181 47 - 220 240 240\n 235 240 240 240 240 240 240 240 240 149 107 62 63 84 71 186\n - 234 229 227 240 236 234 236 231 229 225 150 150 149 121 149 149\n240 240 240 - 240 240 240 240 240 240 240 240 216 85 73 164 212\n 240 240 240 240 240 240 - 240 240 240 240 226 53 186 170 166 176\n 240 240 240 240 240 240 240 240 240 - 240 180 50 217 240 120 77\n 240 240 240 240 240 240 240 240 240 240 240 120 - 52 156 51 152\n 238 240 240 240 240 240 240 240 240 240 237 237 152 125 137 - 230\n 240 240 240 240 240 240 240 240 240 240 223 29 150 236 240 236\n236 240 - 240 240 240 240 240 240 240 240 232 78 5 100 99 192\n240 240 240 240 240 - 240 240 240 240 240 240 197 142 128 121 207\n 235 240 240 240 240 240 240 240 - 240 186 162 168 101 92 109 156\n 240 240 240 240 240 240 240 240 240 225 115 - 103 106 121 109 150\n 234 240 240 240 240 240 240 240 240 216 206 184 184 184 - 210 220\n 240 240 240 240 240 240 240 240 240 186 72 51 61 65 76 98\n233 - 240 240 240 240 240 240 240 240 240 231 213 74 219 240 240\n240 240 240 240 - 240 240 240 240 240 240 240 187 51 219 240 240\n 235 240 240 240 240 240 240 - 240 240 156 117 74 77 89 71 186\n 235 229 227 240 236 234 236 232 229 225 - 150 150 144 117 148 140\n 233 239 240 240 240 240 240 240 240 240 240 216 85 - 72 155 209\n 240 240 240 240 240 240 240 240 240 240 226 53 186 163 153 175\n - 240 240 240 240 240 240 240 240 240 240 180 50 217 240 118 77\n240 240 240 - 240 240 240 240 240 240 240 240 120 45 155 51 152\n 238 240 240 240 240 240 - 240 240 240 240 240 240 150 125 137 230\n 240 240 240 240 240 240 240 240 240 - 240 225 30 151 237 232 235\n 236 240 240 240 240 240 240 240 240 240 236 92 - 17 107 95 178\n 240 240 240 240 240 240 240 240 240 240 238 200 148 128 121 - 206\n 235 240 240 240 240 240 240 240 240 180 151 170 110 101 108 154\n240 240 - 240 240 240 240 240 240 240 225 115 109 106 109 85 141\n234 240 240 240 240 - 240 240 240 240 212 205 184 184 179 201 220\n 240 240 240 240 240 240 240 240 - 240 182 66 47 50 58 76 98\n 233 240 240 240 240 240 240 240 240 240 228 - 211 73 219 240 240\n 240 240 240 240 240 240 240 240 240 240 238 186 51 219 - 240 240\n 235 240 240 240 240 240 240 240 240 156 116 84 83 98 86 189\n234 - 229 227 240 234 232 235 232 228 225 150 156 147 127 155 149\n\n209 175 77 152 - 227 236 191 207 152 135 219 98 240 240 186 149\n 155 161 119 51 129 240 108 - 122 109 98 210 76 240 240 71 149\n 64 161 232 155 124 237 109 128 92 121 - 180 58 222 220 84 121\n 83 186 217 45 150 150 5 142 101 113 184 53 78 - 47 63 149\n 207 53 50 120 237 29 72 197 169 113 187 62 213 181 62 150\n - 240 226 180 237 226 223 228 238 147 115 208 75 231 238 107 150\n240 240 240 - 238 237 240 240 240 174 225 216 186 240 240 149 225\n240 240 240 240 240 240 - 240 240 240 240 240 240 240 240 240 229\n 240 240 240 240 240 240 240 240 240 - 240 240 240 240 240 240 231\n 240 240 240 240 240 240 240 240 240 240 240 240 - 240 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 - 234\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 - 240 240 240 240 240 240 240 240 240 240 240 240 240 240\n 239 240 240 240 240 - 240 240 240 240 240 240 240 240 240 240 227\n 228 240 240 240 240 240 240 240 - 240 240 240 240 240 240 240 229\n 232 240 240 240 238 240 237 240 235 240 234 - 240 233 240 235 234\n 212 176 77 152 230 236 192 207 156 150 220 98 240 240 - 186 140\n 164 166 120 51 137 240 99 121 109 109 210 76 240 240 71 148\n - 73 170 240 156 125 236 100 128 92 121 184 65 219 219 89 117\n 85 186 217 - 52 152 150 5 142 101 106 184 61 74 51 77 144\n 216 53 50 120 237 29 - 78 197 168 103 184 51 213 187 74 150\n 240 226 180 240 237 223 232 240 162 - 115 206 72 231 240 117 150\n 240 240 240 240 240 240 240 240 186 225 216 186 - 240 240 156 225\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 - 229\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n240 240 - 240 240 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 240 240 240 - 240 240 240 240 240 240 240 240 240 240 234\n 240 240 240 240 240 240 240 240 - 240 240 240 240 240 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 - 240 240 240 240 240\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 - 240 227\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229\n240 - 240 240 240 238 240 236 240 235 240 234 240 233 240 235 235\n 209 175 77 152 - 230 235 178 206 154 141 220 98 240 240 189 149\n 155 153 118 51 137 232 95 - 121 108 85 201 76 240 240 86 155\n 72 163 240 155 125 237 107 128 101 109 - 179 58 219 219 98 127\n 85 186 217 45 150 151 17 148 110 106 184 50 73 - 51 83 147\n 216 53 50 120 240 30 92 200 170 109 184 47 211 186 84 156\n240 - 226 180 240 240 225 236 238 151 115 205 66 228 238 116 150\n240 240 240 240 - 240 240 240 240 180 225 212 182 240 240 156 225\n 240 240 240 240 240 240 240 - 240 240 240 240 240 240 240 240 228\n 240 240 240 240 240 240 240 240 240 240 - 240 240 240 240 240 232\n 240 240 240 240 240 240 240 240 240 240 240 240 240 - 240 240 235\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n - 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234\n240 240 240 - 240 240 240 240 240 240 240 240 240 240 240 240 240\n240 240 240 240 240 240 - 240 240 240 240 240 240 240 240 240 227\n 239 240 240 240 240 240 240 240 240 - 240 240 240 240 240 240 229\n 233 240 240 240 238 240 236 240 235 240 234 240 - 233 240 235 234\n\n 149 149 121 149 150 150 225 229 231 236 234 236 240 227 229 - 234\n 186 71 84 63 62 107 149 240 240 240 240 240 240 240 240 235\n240 240 - 220 47 181 238 240 240 240 240 240 240 240 240 240 240\n 240 240 222 78 213 - 231 240 240 240 240 240 240 240 240 240 233\n 98 76 58 53 62 75 186 240 - 240 240 240 240 240 240 240 240\n 219 210 180 184 187 208 216 240 240 240 240 - 240 240 240 240 234\n 135 98 121 113 113 115 225 240 240 240 240 240 240 240 - 240 240\n 152 109 92 101 169 147 174 240 240 240 240 240 240 240 240 235\n207 - 122 128 142 197 238 240 240 240 240 240 240 240 240 240 240\n191 108 109 5 - 72 228 240 240 240 240 240 240 240 240 240 237\n236 240 237 150 29 223 240 240 + 220 240 240\n 235 240 240 240 240 240 240 240 240 149 107 62 63 84 71 186\n234 + 229 227 240 236 234 236 231 229 225 150 150 149 121 149 149\n240 240 240 240 + 240 240 240 240 240 240 240 216 85 73 164 212\n 240 240 240 240 240 240 240 + 240 240 240 226 53 186 170 166 176\n 240 240 240 240 240 240 240 240 240 240 + 180 50 217 240 120 77\n 240 240 240 240 240 240 240 240 240 240 240 120 52 + 156 51 152\n 238 240 240 240 240 240 240 240 240 240 237 237 152 125 137 230\n + 240 240 240 240 240 240 240 240 240 240 223 29 150 236 240 236\n236 240 240 + 240 240 240 240 240 240 240 232 78 5 100 99 192\n240 240 240 240 240 240 + 240 240 240 240 240 197 142 128 121 207\n 235 240 240 240 240 240 240 240 240 + 186 162 168 101 92 109 156\n 240 240 240 240 240 240 240 240 240 225 115 103 + 106 121 109 150\n 234 240 240 240 240 240 240 240 240 216 206 184 184 184 210 + 220\n 240 240 240 240 240 240 240 240 240 186 72 51 61 65 76 98\n233 240 + 240 240 240 240 240 240 240 240 231 213 74 219 240 240\n240 240 240 240 240 + 240 240 240 240 240 240 187 51 219 240 240\n 235 240 240 240 240 240 240 240 + 240 156 117 74 77 89 71 186\n 235 229 227 240 236 234 236 232 229 225 150 + 150 144 117 148 140\n 233 239 240 240 240 240 240 240 240 240 240 216 85 72 + 155 209\n 240 240 240 240 240 240 240 240 240 240 226 53 186 163 153 175\n240 + 240 240 240 240 240 240 240 240 240 180 50 217 240 118 77\n240 240 240 240 + 240 240 240 240 240 240 240 120 45 155 51 152\n 238 240 240 240 240 240 240 + 240 240 240 240 240 150 125 137 230\n 240 240 240 240 240 240 240 240 240 240 + 225 30 151 237 232 235\n 236 240 240 240 240 240 240 240 240 240 236 92 17 + 107 95 178\n 240 240 240 240 240 240 240 240 240 240 238 200 148 128 121 206\n + 235 240 240 240 240 240 240 240 240 180 151 170 110 101 108 154\n240 240 240 + 240 240 240 240 240 240 225 115 109 106 109 85 141\n234 240 240 240 240 240 + 240 240 240 212 205 184 184 179 201 220\n 240 240 240 240 240 240 240 240 240 + 182 66 47 50 58 76 98\n 233 240 240 240 240 240 240 240 240 240 228 211 + 73 219 240 240\n 240 240 240 240 240 240 240 240 240 240 238 186 51 219 240 + 240\n 235 240 240 240 240 240 240 240 240 156 116 84 83 98 86 189\n234 229 + 227 240 234 232 235 232 228 225 150 156 147 127 155 149\n\n209 175 77 152 227 + 236 191 207 152 135 219 98 240 240 186 149\n 155 161 119 51 129 240 108 122 + 109 98 210 76 240 240 71 149\n 64 161 232 155 124 237 109 128 92 121 180 + 58 222 220 84 121\n 83 186 217 45 150 150 5 142 101 113 184 53 78 47 + 63 149\n 207 53 50 120 237 29 72 197 169 113 187 62 213 181 62 150\n240 + 226 180 237 226 223 228 238 147 115 208 75 231 238 107 150\n240 240 240 238 + 237 240 240 240 174 225 216 186 240 240 149 225\n240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 229\n 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 231\n 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234\n + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240\n 239 240 240 240 240 240 + 240 240 240 240 240 240 240 240 240 227\n 228 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 229\n 232 240 240 240 238 240 237 240 235 240 234 240 + 233 240 235 234\n 212 176 77 152 230 236 192 207 156 150 220 98 240 240 186 + 140\n 164 166 120 51 137 240 99 121 109 109 210 76 240 240 71 148\n 73 170 + 240 156 125 236 100 128 92 121 184 65 219 219 89 117\n 85 186 217 52 152 + 150 5 142 101 106 184 61 74 51 77 144\n 216 53 50 120 237 29 78 197 + 168 103 184 51 213 187 74 150\n 240 226 180 240 237 223 232 240 162 115 206 + 72 231 240 117 150\n 240 240 240 240 240 240 240 240 186 225 216 186 240 240 + 156 225\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229\n 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 234\n 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 227\n + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229\n240 240 240 + 240 238 240 236 240 235 240 234 240 233 240 235 235\n 209 175 77 152 230 235 + 178 206 154 141 220 98 240 240 189 149\n 155 153 118 51 137 232 95 121 108 + 85 201 76 240 240 86 155\n 72 163 240 155 125 237 107 128 101 109 179 58 + 219 219 98 127\n 85 186 217 45 150 151 17 148 110 106 184 50 73 51 83 + 147\n 216 53 50 120 240 30 92 200 170 109 184 47 211 186 84 156\n240 226 + 180 240 240 225 236 238 151 115 205 66 228 238 116 150\n240 240 240 240 240 + 240 240 240 180 225 212 182 240 240 156 225\n 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 228\n 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 232\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 235\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234\n240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240\n240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 227\n 239 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 229\n 233 240 240 240 238 240 236 240 235 240 234 240 233 + 240 235 234\n\n 149 149 121 149 150 150 225 229 231 236 234 236 240 227 229 234\n + 186 71 84 63 62 107 149 240 240 240 240 240 240 240 240 235\n240 240 220 + 47 181 238 240 240 240 240 240 240 240 240 240 240\n 240 240 222 78 213 231 + 240 240 240 240 240 240 240 240 240 233\n 98 76 58 53 62 75 186 240 240 + 240 240 240 240 240 240 240\n 219 210 180 184 187 208 216 240 240 240 240 240 + 240 240 240 234\n 135 98 121 113 113 115 225 240 240 240 240 240 240 240 240 + 240\n 152 109 92 101 169 147 174 240 240 240 240 240 240 240 240 235\n207 122 + 128 142 197 238 240 240 240 240 240 240 240 240 240 240\n191 108 109 5 72 + 228 240 240 240 240 240 240 240 240 240 237\n236 240 237 150 29 223 240 240 240 240 240 240 240 240 240 240\n 227 129 124 150 237 226 237 240 240 240 240 240 240 240 240 238\n 152 51 155 45 120 237 238 240 240 240 240 240 240 240 240 240\n 77 119 232 217 50 180 240 240 240 240 240 240 240 240 240 240\n175 @@ -767,26 +768,26 @@ MonoBehaviour: 184 206 216 240 240 240 240 240 240 240 240 234\n 150 109 121 106 103 115 225 240 240 240 240 240 240 240 240 240\n156 109 92 101 168 162 186 240 240 240 240 240 240 240 240 235\n 207 121 128 142 197 240 240 240 240 240 240 240 240 - 240 240 240\n 192 99 100 5 78 232 240 240 240 240 240 240 240 240 240 236\n - 236 240 236 150 29 223 240 240 240 240 240 240 240 240 240 240\n 230 137 125 - 152 237 237 240 240 240 240 240 240 240 240 240 238\n152 51 156 52 120 240 - 240 240 240 240 240 240 240 240 240 240\n 77 120 240 217 50 180 240 240 240 - 240 240 240 240 240 240 240\n 176 166 170 186 53 226 240 240 240 240 240 240 - 240 240 240 240\n 212 164 73 85 216 240 240 240 240 240 240 240 240 240 240 - 240\n 149 155 127 147 156 150 225 228 232 235 232 234 240 227 229 234\n189 86 - 98 83 84 116 156 240 240 240 240 240 240 240 240 235\n240 240 219 51 186 238 - 240 240 240 240 240 240 240 240 240 240\n 240 240 219 73 211 228 240 240 240 - 240 240 240 240 240 240 233\n 98 76 58 50 47 66 182 240 240 240 240 240 - 240 240 240 240\n 220 201 179 184 184 205 212 240 240 240 240 240 240 240 240 - 234\n 141 85 109 106 109 115 225 240 240 240 240 240 240 240 240 240\n 154 108 - 101 110 170 151 180 240 240 240 240 240 240 240 240 235\n206 121 128 148 200 - 238 240 240 240 240 240 240 240 240 240 240\n 178 95 107 17 92 236 240 240 - 240 240 240 240 240 240 240 236\n 235 232 237 151 30 225 240 240 240 240 240 - 240 240 240 240 240\n 230 137 125 150 240 240 240 240 240 240 240 240 240 240 - 240 238\n 152 51 155 45 120 240 240 240 240 240 240 240 240 240 240 240\n - 77 118 240 217 50 180 240 240 240 240 240 240 240 240 240 240\n 175 153 163 - 186 53 226 240 240 240 240 240 240 240 240 240 240\n209 155 72 85 216 240 - 240 240 240 240 240 240 240 240 239 233\n\n" + 240 240 240\n 192 99 100 5 78 232 240 240 240 240 240 240 240 240 240 236\n236 + 240 236 150 29 223 240 240 240 240 240 240 240 240 240 240\n 230 137 125 152 + 237 237 240 240 240 240 240 240 240 240 240 238\n152 51 156 52 120 240 240 + 240 240 240 240 240 240 240 240 240\n 77 120 240 217 50 180 240 240 240 240 + 240 240 240 240 240 240\n 176 166 170 186 53 226 240 240 240 240 240 240 240 + 240 240 240\n 212 164 73 85 216 240 240 240 240 240 240 240 240 240 240 240\n + 149 155 127 147 156 150 225 228 232 235 232 234 240 227 229 234\n189 86 98 + 83 84 116 156 240 240 240 240 240 240 240 240 235\n240 240 219 51 186 238 240 + 240 240 240 240 240 240 240 240 240\n 240 240 219 73 211 228 240 240 240 240 + 240 240 240 240 240 233\n 98 76 58 50 47 66 182 240 240 240 240 240 240 + 240 240 240\n 220 201 179 184 184 205 212 240 240 240 240 240 240 240 240 234\n + 141 85 109 106 109 115 225 240 240 240 240 240 240 240 240 240\n 154 108 101 + 110 170 151 180 240 240 240 240 240 240 240 240 235\n206 121 128 148 200 238 + 240 240 240 240 240 240 240 240 240 240\n 178 95 107 17 92 236 240 240 240 + 240 240 240 240 240 240 236\n 235 232 237 151 30 225 240 240 240 240 240 240 + 240 240 240 240\n 230 137 125 150 240 240 240 240 240 240 240 240 240 240 240 + 238\n 152 51 155 45 120 240 240 240 240 240 240 240 240 240 240 240\n 77 118 + 240 217 50 180 240 240 240 240 240 240 240 240 240 240\n 175 153 163 186 53 + 226 240 240 240 240 240 240 240 240 240 240\n209 155 72 85 216 240 240 240 + 240 240 240 240 240 240 239 233\n\n" PatternWidth: 0.08 BarcodeID: 0 MultiConfigFile: @@ -1061,11 +1062,11 @@ MonoBehaviour: 240 240 240 240 240 240 240 240 240 240 240 240\n 228 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240\n 225 156 240 240 182 212 225 180 240 240 240 240 240 240 240 240\n 150 116 238 228 66 205 115 151 238 236 225 240 240 - 180 226 240\n 156 84 186 211 47 184 109 170 200 92 30 240 120 50 53 216\n - 147 83 51 73 50 184 106 110 148 17 151 150 45 217 186 85\n127 98 219 - 219 58 179 109 101 128 107 237 125 155 240 163 72\n 155 86 240 240 76 201 - 85 108 121 95 232 137 51 118 153 155\n 149 189 240 240 98 220 141 154 206 - 178 235 230 152 77 175 209\n\n 232 228 239 240 240 240 240 240 240 240 240 207 + 180 226 240\n 156 84 186 211 47 184 109 170 200 92 30 240 120 50 53 216\n147 + 83 51 73 50 184 106 110 148 17 151 150 45 217 186 85\n127 98 219 219 + 58 179 109 101 128 107 237 125 155 240 163 72\n 155 86 240 240 76 201 85 + 108 121 95 232 137 51 118 153 155\n 149 189 240 240 98 220 141 154 206 178 + 235 230 152 77 175 209\n\n 232 228 239 240 240 240 240 240 240 240 240 207 83 64 155 209\n 240 240 240 240 240 240 240 240 240 240 226 53 186 161 161 175\n 240 240 240 240 240 240 240 240 240 240 180 50 217 232 119 77\n240 240 240 240 240 240 240 240 240 238 237 120 45 155 51 152\n238 240 240 240 240 @@ -1077,84 +1078,84 @@ MonoBehaviour: 240 240 240 240 240 216 208 187 184 180 210 219\n 240 240 240 240 240 240 240 240 240 186 75 62 53 58 76 98\n 233 240 240 240 240 240 240 240 240 240 231 213 78 222 240 240\n 240 240 240 240 240 240 240 240 240 240 238 181 47 - 220 240 240\n 235 240 240 240 240 240 240 240 240 149 107 62 63 84 71 186\n - 234 229 227 240 236 234 236 231 229 225 150 150 149 121 149 149\n240 240 240 - 240 240 240 240 240 240 240 240 216 85 73 164 212\n 240 240 240 240 240 240 - 240 240 240 240 226 53 186 170 166 176\n 240 240 240 240 240 240 240 240 240 - 240 180 50 217 240 120 77\n 240 240 240 240 240 240 240 240 240 240 240 120 - 52 156 51 152\n 238 240 240 240 240 240 240 240 240 240 237 237 152 125 137 - 230\n 240 240 240 240 240 240 240 240 240 240 223 29 150 236 240 236\n236 240 - 240 240 240 240 240 240 240 240 232 78 5 100 99 192\n240 240 240 240 240 - 240 240 240 240 240 240 197 142 128 121 207\n 235 240 240 240 240 240 240 240 - 240 186 162 168 101 92 109 156\n 240 240 240 240 240 240 240 240 240 225 115 - 103 106 121 109 150\n 234 240 240 240 240 240 240 240 240 216 206 184 184 184 - 210 220\n 240 240 240 240 240 240 240 240 240 186 72 51 61 65 76 98\n233 - 240 240 240 240 240 240 240 240 240 231 213 74 219 240 240\n240 240 240 240 - 240 240 240 240 240 240 240 187 51 219 240 240\n 235 240 240 240 240 240 240 - 240 240 156 117 74 77 89 71 186\n 235 229 227 240 236 234 236 232 229 225 - 150 150 144 117 148 140\n 233 239 240 240 240 240 240 240 240 240 240 216 85 - 72 155 209\n 240 240 240 240 240 240 240 240 240 240 226 53 186 163 153 175\n - 240 240 240 240 240 240 240 240 240 240 180 50 217 240 118 77\n240 240 240 - 240 240 240 240 240 240 240 240 120 45 155 51 152\n 238 240 240 240 240 240 - 240 240 240 240 240 240 150 125 137 230\n 240 240 240 240 240 240 240 240 240 - 240 225 30 151 237 232 235\n 236 240 240 240 240 240 240 240 240 240 236 92 - 17 107 95 178\n 240 240 240 240 240 240 240 240 240 240 238 200 148 128 121 - 206\n 235 240 240 240 240 240 240 240 240 180 151 170 110 101 108 154\n240 240 - 240 240 240 240 240 240 240 225 115 109 106 109 85 141\n234 240 240 240 240 - 240 240 240 240 212 205 184 184 179 201 220\n 240 240 240 240 240 240 240 240 - 240 182 66 47 50 58 76 98\n 233 240 240 240 240 240 240 240 240 240 228 - 211 73 219 240 240\n 240 240 240 240 240 240 240 240 240 240 238 186 51 219 - 240 240\n 235 240 240 240 240 240 240 240 240 156 116 84 83 98 86 189\n234 - 229 227 240 234 232 235 232 228 225 150 156 147 127 155 149\n\n209 175 77 152 - 227 236 191 207 152 135 219 98 240 240 186 149\n 155 161 119 51 129 240 108 - 122 109 98 210 76 240 240 71 149\n 64 161 232 155 124 237 109 128 92 121 - 180 58 222 220 84 121\n 83 186 217 45 150 150 5 142 101 113 184 53 78 - 47 63 149\n 207 53 50 120 237 29 72 197 169 113 187 62 213 181 62 150\n - 240 226 180 237 226 223 228 238 147 115 208 75 231 238 107 150\n240 240 240 - 238 237 240 240 240 174 225 216 186 240 240 149 225\n240 240 240 240 240 240 - 240 240 240 240 240 240 240 240 240 229\n 240 240 240 240 240 240 240 240 240 - 240 240 240 240 240 240 231\n 240 240 240 240 240 240 240 240 240 240 240 240 - 240 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 - 234\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 - 240 240 240 240 240 240 240 240 240 240 240 240 240 240\n 239 240 240 240 240 - 240 240 240 240 240 240 240 240 240 240 227\n 228 240 240 240 240 240 240 240 - 240 240 240 240 240 240 240 229\n 232 240 240 240 238 240 237 240 235 240 234 - 240 233 240 235 234\n 212 176 77 152 230 236 192 207 156 150 220 98 240 240 - 186 140\n 164 166 120 51 137 240 99 121 109 109 210 76 240 240 71 148\n - 73 170 240 156 125 236 100 128 92 121 184 65 219 219 89 117\n 85 186 217 - 52 152 150 5 142 101 106 184 61 74 51 77 144\n 216 53 50 120 237 29 - 78 197 168 103 184 51 213 187 74 150\n 240 226 180 240 237 223 232 240 162 - 115 206 72 231 240 117 150\n 240 240 240 240 240 240 240 240 186 225 216 186 - 240 240 156 225\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 - 229\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n240 240 - 240 240 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 240 240 240 - 240 240 240 240 240 240 240 240 240 240 234\n 240 240 240 240 240 240 240 240 - 240 240 240 240 240 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 - 240 240 240 240 240\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 - 240 227\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229\n240 - 240 240 240 238 240 236 240 235 240 234 240 233 240 235 235\n 209 175 77 152 - 230 235 178 206 154 141 220 98 240 240 189 149\n 155 153 118 51 137 232 95 - 121 108 85 201 76 240 240 86 155\n 72 163 240 155 125 237 107 128 101 109 - 179 58 219 219 98 127\n 85 186 217 45 150 151 17 148 110 106 184 50 73 - 51 83 147\n 216 53 50 120 240 30 92 200 170 109 184 47 211 186 84 156\n240 - 226 180 240 240 225 236 238 151 115 205 66 228 238 116 150\n240 240 240 240 - 240 240 240 240 180 225 212 182 240 240 156 225\n 240 240 240 240 240 240 240 - 240 240 240 240 240 240 240 240 228\n 240 240 240 240 240 240 240 240 240 240 - 240 240 240 240 240 232\n 240 240 240 240 240 240 240 240 240 240 240 240 240 - 240 240 235\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n - 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234\n240 240 240 - 240 240 240 240 240 240 240 240 240 240 240 240 240\n240 240 240 240 240 240 - 240 240 240 240 240 240 240 240 240 227\n 239 240 240 240 240 240 240 240 240 - 240 240 240 240 240 240 229\n 233 240 240 240 238 240 236 240 235 240 234 240 - 233 240 235 234\n\n 149 149 121 149 150 150 225 229 231 236 234 236 240 227 229 - 234\n 186 71 84 63 62 107 149 240 240 240 240 240 240 240 240 235\n240 240 - 220 47 181 238 240 240 240 240 240 240 240 240 240 240\n 240 240 222 78 213 - 231 240 240 240 240 240 240 240 240 240 233\n 98 76 58 53 62 75 186 240 - 240 240 240 240 240 240 240 240\n 219 210 180 184 187 208 216 240 240 240 240 - 240 240 240 240 234\n 135 98 121 113 113 115 225 240 240 240 240 240 240 240 - 240 240\n 152 109 92 101 169 147 174 240 240 240 240 240 240 240 240 235\n207 - 122 128 142 197 238 240 240 240 240 240 240 240 240 240 240\n191 108 109 5 - 72 228 240 240 240 240 240 240 240 240 240 237\n236 240 237 150 29 223 240 240 + 220 240 240\n 235 240 240 240 240 240 240 240 240 149 107 62 63 84 71 186\n234 + 229 227 240 236 234 236 231 229 225 150 150 149 121 149 149\n240 240 240 240 + 240 240 240 240 240 240 240 216 85 73 164 212\n 240 240 240 240 240 240 240 + 240 240 240 226 53 186 170 166 176\n 240 240 240 240 240 240 240 240 240 240 + 180 50 217 240 120 77\n 240 240 240 240 240 240 240 240 240 240 240 120 52 + 156 51 152\n 238 240 240 240 240 240 240 240 240 240 237 237 152 125 137 230\n + 240 240 240 240 240 240 240 240 240 240 223 29 150 236 240 236\n236 240 240 + 240 240 240 240 240 240 240 232 78 5 100 99 192\n240 240 240 240 240 240 + 240 240 240 240 240 197 142 128 121 207\n 235 240 240 240 240 240 240 240 240 + 186 162 168 101 92 109 156\n 240 240 240 240 240 240 240 240 240 225 115 103 + 106 121 109 150\n 234 240 240 240 240 240 240 240 240 216 206 184 184 184 210 + 220\n 240 240 240 240 240 240 240 240 240 186 72 51 61 65 76 98\n233 240 + 240 240 240 240 240 240 240 240 231 213 74 219 240 240\n240 240 240 240 240 + 240 240 240 240 240 240 187 51 219 240 240\n 235 240 240 240 240 240 240 240 + 240 156 117 74 77 89 71 186\n 235 229 227 240 236 234 236 232 229 225 150 + 150 144 117 148 140\n 233 239 240 240 240 240 240 240 240 240 240 216 85 72 + 155 209\n 240 240 240 240 240 240 240 240 240 240 226 53 186 163 153 175\n240 + 240 240 240 240 240 240 240 240 240 180 50 217 240 118 77\n240 240 240 240 + 240 240 240 240 240 240 240 120 45 155 51 152\n 238 240 240 240 240 240 240 + 240 240 240 240 240 150 125 137 230\n 240 240 240 240 240 240 240 240 240 240 + 225 30 151 237 232 235\n 236 240 240 240 240 240 240 240 240 240 236 92 17 + 107 95 178\n 240 240 240 240 240 240 240 240 240 240 238 200 148 128 121 206\n + 235 240 240 240 240 240 240 240 240 180 151 170 110 101 108 154\n240 240 240 + 240 240 240 240 240 240 225 115 109 106 109 85 141\n234 240 240 240 240 240 + 240 240 240 212 205 184 184 179 201 220\n 240 240 240 240 240 240 240 240 240 + 182 66 47 50 58 76 98\n 233 240 240 240 240 240 240 240 240 240 228 211 + 73 219 240 240\n 240 240 240 240 240 240 240 240 240 240 238 186 51 219 240 + 240\n 235 240 240 240 240 240 240 240 240 156 116 84 83 98 86 189\n234 229 + 227 240 234 232 235 232 228 225 150 156 147 127 155 149\n\n209 175 77 152 227 + 236 191 207 152 135 219 98 240 240 186 149\n 155 161 119 51 129 240 108 122 + 109 98 210 76 240 240 71 149\n 64 161 232 155 124 237 109 128 92 121 180 + 58 222 220 84 121\n 83 186 217 45 150 150 5 142 101 113 184 53 78 47 + 63 149\n 207 53 50 120 237 29 72 197 169 113 187 62 213 181 62 150\n240 + 226 180 237 226 223 228 238 147 115 208 75 231 238 107 150\n240 240 240 238 + 237 240 240 240 174 225 216 186 240 240 149 225\n240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 229\n 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 231\n 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234\n + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240\n 239 240 240 240 240 240 + 240 240 240 240 240 240 240 240 240 227\n 228 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 229\n 232 240 240 240 238 240 237 240 235 240 234 240 + 233 240 235 234\n 212 176 77 152 230 236 192 207 156 150 220 98 240 240 186 + 140\n 164 166 120 51 137 240 99 121 109 109 210 76 240 240 71 148\n 73 170 + 240 156 125 236 100 128 92 121 184 65 219 219 89 117\n 85 186 217 52 152 + 150 5 142 101 106 184 61 74 51 77 144\n 216 53 50 120 237 29 78 197 + 168 103 184 51 213 187 74 150\n 240 226 180 240 237 223 232 240 162 115 206 + 72 231 240 117 150\n 240 240 240 240 240 240 240 240 186 225 216 186 240 240 + 156 225\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229\n 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 236\n240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 234\n 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 236\n 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 227\n + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229\n240 240 240 + 240 238 240 236 240 235 240 234 240 233 240 235 235\n 209 175 77 152 230 235 + 178 206 154 141 220 98 240 240 189 149\n 155 153 118 51 137 232 95 121 108 + 85 201 76 240 240 86 155\n 72 163 240 155 125 237 107 128 101 109 179 58 + 219 219 98 127\n 85 186 217 45 150 151 17 148 110 106 184 50 73 51 83 + 147\n 216 53 50 120 240 30 92 200 170 109 184 47 211 186 84 156\n240 226 + 180 240 240 225 236 238 151 115 205 66 228 238 116 150\n240 240 240 240 240 + 240 240 240 180 225 212 182 240 240 156 225\n 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 228\n 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 232\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 235\n 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232\n240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234\n240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240\n240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 227\n 239 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 229\n 233 240 240 240 238 240 236 240 235 240 234 240 233 + 240 235 234\n\n 149 149 121 149 150 150 225 229 231 236 234 236 240 227 229 234\n + 186 71 84 63 62 107 149 240 240 240 240 240 240 240 240 235\n240 240 220 + 47 181 238 240 240 240 240 240 240 240 240 240 240\n 240 240 222 78 213 231 + 240 240 240 240 240 240 240 240 240 233\n 98 76 58 53 62 75 186 240 240 + 240 240 240 240 240 240 240\n 219 210 180 184 187 208 216 240 240 240 240 240 + 240 240 240 234\n 135 98 121 113 113 115 225 240 240 240 240 240 240 240 240 + 240\n 152 109 92 101 169 147 174 240 240 240 240 240 240 240 240 235\n207 122 + 128 142 197 238 240 240 240 240 240 240 240 240 240 240\n191 108 109 5 72 + 228 240 240 240 240 240 240 240 240 240 237\n236 240 237 150 29 223 240 240 240 240 240 240 240 240 240 240\n 227 129 124 150 237 226 237 240 240 240 240 240 240 240 240 238\n 152 51 155 45 120 237 238 240 240 240 240 240 240 240 240 240\n 77 119 232 217 50 180 240 240 240 240 240 240 240 240 240 240\n175 @@ -1167,26 +1168,26 @@ MonoBehaviour: 184 206 216 240 240 240 240 240 240 240 240 234\n 150 109 121 106 103 115 225 240 240 240 240 240 240 240 240 240\n156 109 92 101 168 162 186 240 240 240 240 240 240 240 240 235\n 207 121 128 142 197 240 240 240 240 240 240 240 240 - 240 240 240\n 192 99 100 5 78 232 240 240 240 240 240 240 240 240 240 236\n - 236 240 236 150 29 223 240 240 240 240 240 240 240 240 240 240\n 230 137 125 - 152 237 237 240 240 240 240 240 240 240 240 240 238\n152 51 156 52 120 240 - 240 240 240 240 240 240 240 240 240 240\n 77 120 240 217 50 180 240 240 240 - 240 240 240 240 240 240 240\n 176 166 170 186 53 226 240 240 240 240 240 240 - 240 240 240 240\n 212 164 73 85 216 240 240 240 240 240 240 240 240 240 240 - 240\n 149 155 127 147 156 150 225 228 232 235 232 234 240 227 229 234\n189 86 - 98 83 84 116 156 240 240 240 240 240 240 240 240 235\n240 240 219 51 186 238 - 240 240 240 240 240 240 240 240 240 240\n 240 240 219 73 211 228 240 240 240 - 240 240 240 240 240 240 233\n 98 76 58 50 47 66 182 240 240 240 240 240 - 240 240 240 240\n 220 201 179 184 184 205 212 240 240 240 240 240 240 240 240 - 234\n 141 85 109 106 109 115 225 240 240 240 240 240 240 240 240 240\n 154 108 - 101 110 170 151 180 240 240 240 240 240 240 240 240 235\n206 121 128 148 200 - 238 240 240 240 240 240 240 240 240 240 240\n 178 95 107 17 92 236 240 240 - 240 240 240 240 240 240 240 236\n 235 232 237 151 30 225 240 240 240 240 240 - 240 240 240 240 240\n 230 137 125 150 240 240 240 240 240 240 240 240 240 240 - 240 238\n 152 51 155 45 120 240 240 240 240 240 240 240 240 240 240 240\n - 77 118 240 217 50 180 240 240 240 240 240 240 240 240 240 240\n 175 153 163 - 186 53 226 240 240 240 240 240 240 240 240 240 240\n209 155 72 85 216 240 - 240 240 240 240 240 240 240 240 239 233\n\n" + 240 240 240\n 192 99 100 5 78 232 240 240 240 240 240 240 240 240 240 236\n236 + 240 236 150 29 223 240 240 240 240 240 240 240 240 240 240\n 230 137 125 152 + 237 237 240 240 240 240 240 240 240 240 240 238\n152 51 156 52 120 240 240 + 240 240 240 240 240 240 240 240 240\n 77 120 240 217 50 180 240 240 240 240 + 240 240 240 240 240 240\n 176 166 170 186 53 226 240 240 240 240 240 240 240 + 240 240 240\n 212 164 73 85 216 240 240 240 240 240 240 240 240 240 240 240\n + 149 155 127 147 156 150 225 228 232 235 232 234 240 227 229 234\n189 86 98 + 83 84 116 156 240 240 240 240 240 240 240 240 235\n240 240 219 51 186 238 240 + 240 240 240 240 240 240 240 240 240\n 240 240 219 73 211 228 240 240 240 240 + 240 240 240 240 240 233\n 98 76 58 50 47 66 182 240 240 240 240 240 240 + 240 240 240\n 220 201 179 184 184 205 212 240 240 240 240 240 240 240 240 234\n + 141 85 109 106 109 115 225 240 240 240 240 240 240 240 240 240\n 154 108 101 + 110 170 151 180 240 240 240 240 240 240 240 240 235\n206 121 128 148 200 238 + 240 240 240 240 240 240 240 240 240 240\n 178 95 107 17 92 236 240 240 240 + 240 240 240 240 240 240 236\n 235 232 237 151 30 225 240 240 240 240 240 240 + 240 240 240 240\n 230 137 125 150 240 240 240 240 240 240 240 240 240 240 240 + 238\n 152 51 155 45 120 240 240 240 240 240 240 240 240 240 240 240\n 77 118 + 240 217 50 180 240 240 240 240 240 240 240 240 240 240\n 175 153 163 186 53 + 226 240 240 240 240 240 240 240 240 240 240\n209 155 72 85 216 240 240 240 + 240 240 240 240 240 240 239 233\n\n" PatternWidth: 0.08 BarcodeID: 0 MultiConfigFile: diff --git a/Source/Package/Assets/artoolkitX-Unity/Scripts/ARController.cs b/Source/Package/Assets/artoolkitX-Unity/Scripts/ARController.cs index 0a7748d..0d00b36 100644 --- a/Source/Package/Assets/artoolkitX-Unity/Scripts/ARController.cs +++ b/Source/Package/Assets/artoolkitX-Unity/Scripts/ARController.cs @@ -372,6 +372,8 @@ public struct ARVideoSourceInfoT [SerializeField] private bool currentNFTMultiMode = false; [SerializeField] + private int currentTwoDMaxMarkersToTrack = 1; + [SerializeField] private AR_LOG_LEVEL currentLogLevel = AR_LOG_LEVEL.AR_LOG_LEVEL_INFO; // Main reference to the plugin functions. Created in OnEnable, destroyed in OnDisable(). @@ -771,6 +773,7 @@ public bool StartAR() MatrixCodeType = currentMatrixCodeType; ImageProcMode = currentImageProcMode; NFTMultiMode = currentNFTMultiMode; + TwoDMaxMarkersToTrack = currentTwoDMaxMarkersToTrack; // Prevent display sleep. Screen.sleepTimeout = SleepTimeout.NeverSleep; @@ -1299,6 +1302,27 @@ public bool NFTMultiMode } } + public int TwoDMaxMarkersToTrack + { + get + { + if (_running) + { + currentTwoDMaxMarkersToTrack = pluginFunctions.arwGet2DMaxMarkersToTrack(); + } + return currentTwoDMaxMarkersToTrack; + } + + set + { + currentTwoDMaxMarkersToTrack = value; + if (_running) + { + pluginFunctions.arwSet2DMaxMarkersToTrack(currentTwoDMaxMarkersToTrack); + } + } + } + public AR_LOG_LEVEL LogLevel { get diff --git a/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARControllerEditor.cs b/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARControllerEditor.cs index 7221b55..dc8d8a8 100644 --- a/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARControllerEditor.cs +++ b/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARControllerEditor.cs @@ -50,6 +50,7 @@ public class ARControllerEditor : Editor public bool showVideoOptions = true; public bool showThresholdOptions = false; public bool showSquareTrackingOptions = false; + public bool show2DTrackingOptions = false; public bool showNFTTrackingOptions = false; public bool showApplicationOptions = false; @@ -124,51 +125,53 @@ public override void OnInspectorGUI() EditorGUILayout.Separator(); - showThresholdOptions = EditorGUILayout.Foldout(showThresholdOptions, "Threshold Options"); - if (showThresholdOptions) + showSquareTrackingOptions = EditorGUILayout.Foldout(showSquareTrackingOptions, "Square Tracking Options"); + if (showSquareTrackingOptions) { - // Threshold mode selection - ARController.ARToolKitThresholdMode currentThreshMode = arcontroller.VideoThresholdMode; - ARController.ARToolKitThresholdMode newThreshMode = (ARController.ARToolKitThresholdMode)EditorGUILayout.EnumPopup("Mode:", currentThreshMode); - if (newThreshMode != currentThreshMode) + showThresholdOptions = EditorGUILayout.Foldout(showThresholdOptions, "Threshold Options"); + if (showThresholdOptions) { - arcontroller.VideoThresholdMode = newThreshMode; - } - - // Info about the selected mode - EditorGUILayout.LabelField("", thresholdModeDescriptions[newThreshMode]); + // Threshold mode selection + ARController.ARToolKitThresholdMode currentThreshMode = arcontroller.VideoThresholdMode; + ARController.ARToolKitThresholdMode newThreshMode = (ARController.ARToolKitThresholdMode)EditorGUILayout.EnumPopup("Mode:", currentThreshMode); + if (newThreshMode != currentThreshMode) + { + Undo.RecordObject(arcontroller, "Set threshold mode"); + arcontroller.VideoThresholdMode = newThreshMode; + } - // Show threshold slider only in manual or bracketing modes. - if (newThreshMode == ARController.ARToolKitThresholdMode.Manual || newThreshMode == ARController.ARToolKitThresholdMode.Bracketing) - { + // Info about the selected mode + EditorGUILayout.LabelField("", thresholdModeDescriptions[newThreshMode]); - int currentThreshold = arcontroller.VideoThreshold; - //int newThreshold = UnityEngine.Mathf.Clamp(EditorGUILayout.IntField("Threshold: ", currentThreshold), 0, 255); - int newThreshold = EditorGUILayout.IntSlider("Threshold: ", currentThreshold, 0, 255); - if (newThreshold != currentThreshold) + // Show threshold slider only in manual or bracketing modes. + if (newThreshMode == ARController.ARToolKitThresholdMode.Manual || newThreshMode == ARController.ARToolKitThresholdMode.Bracketing) { - arcontroller.VideoThreshold = newThreshold; + + int currentThreshold = arcontroller.VideoThreshold; + //int newThreshold = UnityEngine.Mathf.Clamp(EditorGUILayout.IntField("Threshold: ", currentThreshold), 0, 255); + int newThreshold = EditorGUILayout.IntSlider("Threshold: ", currentThreshold, 0, 255); + if (newThreshold != currentThreshold) + { + Undo.RecordObject(arcontroller, "Set threshold"); + arcontroller.VideoThreshold = newThreshold; + } } } - } - - EditorGUILayout.Separator(); - - showSquareTrackingOptions = EditorGUILayout.Foldout(showSquareTrackingOptions, "Square Tracking Options"); - if (showSquareTrackingOptions) - { + EditorGUILayout.Separator(); int currentTemplateSize = arcontroller.TemplateSize; int newTemplateSize = EditorGUILayout.IntField("Template size: ", currentTemplateSize); if (newTemplateSize != currentTemplateSize && newTemplateSize >= 16 && newTemplateSize <= 64) { + Undo.RecordObject(arcontroller, "Set template size"); arcontroller.TemplateSize = newTemplateSize; } int currentTemplateCountMax = arcontroller.TemplateCountMax; int newTemplateCountMax = EditorGUILayout.IntField("Template count max.: ", currentTemplateCountMax); if (newTemplateCountMax != currentTemplateCountMax && newTemplateCountMax > 0) { + Undo.RecordObject(arcontroller, "Set template count max."); arcontroller.TemplateCountMax = newTemplateCountMax; } @@ -177,6 +180,7 @@ public override void OnInspectorGUI() ARController.ARToolKitLabelingMode newLabelingMode = (ARController.ARToolKitLabelingMode)EditorGUILayout.EnumPopup("Trackable borders:", currentLabelingMode); if (newLabelingMode != currentLabelingMode) { + Undo.RecordObject(arcontroller, "Set labeling mode"); arcontroller.LabelingMode = newLabelingMode; } @@ -185,6 +189,7 @@ public override void OnInspectorGUI() float newBorderSize = UnityEngine.Mathf.Clamp(EditorGUILayout.FloatField("Border size:", currentBorderSize), 0.0f, 0.5f); if (newBorderSize != currentBorderSize) { + Undo.RecordObject(arcontroller, "Set border size"); arcontroller.BorderSize = newBorderSize; } @@ -193,6 +198,7 @@ public override void OnInspectorGUI() ARController.ARToolKitPatternDetectionMode newPatternDetectionMode = (ARController.ARToolKitPatternDetectionMode)EditorGUILayout.EnumPopup("Pattern detection mode:", currentPatternDetectionMode); if (newPatternDetectionMode != currentPatternDetectionMode) { + Undo.RecordObject(arcontroller, "Set pattern detection mode"); arcontroller.PatternDetectionMode = newPatternDetectionMode; } @@ -206,6 +212,7 @@ public override void OnInspectorGUI() ARController.ARToolKitMatrixCodeType newMatrixCodeType = (ARController.ARToolKitMatrixCodeType)EditorGUILayout.EnumPopup("Matrix code type:", currentMatrixCodeType); if (newMatrixCodeType != currentMatrixCodeType) { + Undo.RecordObject(arcontroller, "Set matrix code type"); arcontroller.MatrixCodeType = newMatrixCodeType; } } @@ -215,6 +222,7 @@ public override void OnInspectorGUI() ARController.ARToolKitImageProcMode newImageProcMode = (ARController.ARToolKitImageProcMode)EditorGUILayout.EnumPopup("Image processing mode:", currentImageProcMode); if (newImageProcMode != currentImageProcMode) { + Undo.RecordObject(arcontroller, "Set image processing mode"); arcontroller.ImageProcMode = newImageProcMode; } @@ -222,10 +230,29 @@ public override void OnInspectorGUI() EditorGUILayout.Separator(); + show2DTrackingOptions = EditorGUILayout.Foldout(show2DTrackingOptions, "2D Tracking Options"); + if (show2DTrackingOptions) + { + int n = EditorGUILayout.IntField("Max. number of markers to track", arcontroller.TwoDMaxMarkersToTrack); + if (n != arcontroller.TwoDMaxMarkersToTrack) + { + Undo.RecordObject(arcontroller, "Set max. number of markers to track"); + arcontroller.TwoDMaxMarkersToTrack = n; + + } + } + + EditorGUILayout.Separator(); + showNFTTrackingOptions = EditorGUILayout.Foldout(showNFTTrackingOptions, "NFT Tracking Options"); if (showNFTTrackingOptions) { - arcontroller.NFTMultiMode = EditorGUILayout.Toggle("Multi-page mode", arcontroller.NFTMultiMode); + bool m = EditorGUILayout.Toggle("Multi-page mode", arcontroller.NFTMultiMode); + if (m != arcontroller.NFTMultiMode) + { + Undo.RecordObject(arcontroller, "Set multi-page mode"); + arcontroller.NFTMultiMode = m; + } } EditorGUILayout.Separator(); diff --git a/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARToolKitMenuEditor.cs b/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARToolKitMenuEditor.cs index 7496d01..a329def 100644 --- a/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARToolKitMenuEditor.cs +++ b/Source/Package/Assets/artoolkitX-Unity/Scripts/Editor/ARToolKitMenuEditor.cs @@ -53,11 +53,11 @@ public class ARToolKitMenuEditor : MonoBehaviour { private const string SOURCE_URL = "https://github.com/artoolkitx/artoolkitx"; private const string PLUGIN_SOURCE_URL = "https://github.com/artoolkitx/arunityx"; //private const string TOOLS_URL = "http://artoolkit.org/download-artoolkit-sdk#unity"; - private const string VERSION = MENU_PATH_BASE + "/artoolkitX for Unity Version 1.1.2"; + private const string VERSION = MENU_PATH_BASE + "/artoolkitX for Unity Version 1.1.3"; private const string WINDOWS_UNITY_MESSAGE = "Thank you for choosing artoolkitX for Unity! " + "artoolkitX requires the Microsoft C++ Redistributables to be installed on your system.\n" + "Please select \"{0}\" from the menu above, and install the required packages."; - private const string GET_TOOLS_MESSAGE = "artoolkitX for Unity Version 1.1.2! To make your own markers, you'll need to download our tools.\n" + + private const string GET_TOOLS_MESSAGE = "artoolkitX for Unity Version 1.1.3! To make your own markers, you'll need to download our tools.\n" + "Please select {0} from menu above to download them."; static ARToolKitMenuEditor() { diff --git a/Source/Package/Assets/artoolkitX-Unity/Scripts/IPluginFunctions.cs b/Source/Package/Assets/artoolkitX-Unity/Scripts/IPluginFunctions.cs index 8634d48..5d85927 100644 --- a/Source/Package/Assets/artoolkitX-Unity/Scripts/IPluginFunctions.cs +++ b/Source/Package/Assets/artoolkitX-Unity/Scripts/IPluginFunctions.cs @@ -66,6 +66,8 @@ public abstract class IPluginFunctions abstract public bool arwGetTrackablePatternImage(int markerID, int patternID, [In, Out] Color[] colors); abstract public int arwGetMatrixCodeType(); abstract public bool arwGetNFTMultiMode(); + abstract public void arwSet2DMaxMarkersToTrack(int maxMarkersToTrack); + abstract public int arwGet2DMaxMarkersToTrack(); abstract public int arwGetPatternDetectionMode(); abstract public bool arwGetProjectionMatrix(float nearPlane, float farPlane, float[] matrix); abstract public bool arwGetProjectionMatrixStereo(float nearPlane, float farPlane, float[] matrixL, float[] matrixR); diff --git a/Source/Package/Assets/artoolkitX-Unity/Scripts/PluginFunctionsARX.cs b/Source/Package/Assets/artoolkitX-Unity/Scripts/PluginFunctionsARX.cs index b9ccd32..6ed5eef 100644 --- a/Source/Package/Assets/artoolkitX-Unity/Scripts/PluginFunctionsARX.cs +++ b/Source/Package/Assets/artoolkitX-Unity/Scripts/PluginFunctionsARX.cs @@ -57,7 +57,7 @@ public class PluginFunctionsARX : IPluginFunctions private PluginFunctionsLogCallback logCallback = null; private GCHandle logCallbackGCH; - private static int ARW_TRACKER_OPTION_NFT_MULTIMODE = 0, ///< bool. + private readonly static int ARW_TRACKER_OPTION_NFT_MULTIMODE = 0, ///< bool. ARW_TRACKER_OPTION_SQUARE_THRESHOLD = 1, ///< Threshold value used for image binarization. int in range [0-255]. ARW_TRACKER_OPTION_SQUARE_THRESHOLD_MODE = 2, ///< Threshold mode used for image binarization. int. ARW_TRACKER_OPTION_SQUARE_LABELING_MODE = 3, ///< int. @@ -67,8 +67,9 @@ public class PluginFunctionsARX : IPluginFunctions ARW_TRACKER_OPTION_SQUARE_IMAGE_PROC_MODE = 7, ///< int. ARW_TRACKER_OPTION_SQUARE_DEBUG_MODE = 8, ///< Enables or disable state of debug mode in the tracker. When enabled, a black and white debug image is generated during marker detection. The debug image is useful for visualising the binarization process and choosing a threshold value. bool. ARW_TRACKER_OPTION_SQUARE_PATTERN_SIZE = 9, ///< Number of rows and columns in square template (pattern) markers. Defaults to AR_PATT_SIZE1, which is 16 in all versions of ARToolKit prior to 5.3. int. - ARW_TRACKER_OPTION_SQUARE_PATTERN_COUNT_MAX = 10/*, ///< Maximum number of square template (pattern) markers that may be loaded at once. Defaults to AR_PATT_NUM_MAX, which is at least 25 in all versions of ARToolKit prior to 5.3. int. - ARW_TRACKER_OPTION_2D_TRACKER_FEATURE_TYPE = 11*/; ///< Feature detector type used in the 2d Tracker - 0 AKAZE, 1 ORB, 2 BRISK, 3 KAZE + ARW_TRACKER_OPTION_SQUARE_PATTERN_COUNT_MAX = 10, ///< Maximum number of square template (pattern) markers that may be loaded at once. Defaults to AR_PATT_NUM_MAX, which is at least 25 in all versions of ARToolKit prior to 5.3. int. + /*ARW_TRACKER_OPTION_2D_TRACKER_FEATURE_TYPE = 11,*/ ///< Feature detector type used in the 2d Tracker - 0 AKAZE, 1 ORB, 2 BRISK, 3 KAZE + ARW_TRACKER_OPTION_2D_MAXIMUM_MARKERS_TO_TRACK = 12; ///< Maximum number of markers able to be tracked simultaneously. Defaults to 1. Should not be set higher than the number of 2D markers loaded. override public bool IsConfigured() { @@ -363,6 +364,16 @@ override public bool arwGetNFTMultiMode() return ARX_pinvoke.arwGetTrackerOptionBool(ARW_TRACKER_OPTION_NFT_MULTIMODE); } + override public void arwSet2DMaxMarkersToTrack(int maxMarkersToTrack) + { + ARX_pinvoke.arwSetTrackerOptionInt(ARW_TRACKER_OPTION_2D_MAXIMUM_MARKERS_TO_TRACK, maxMarkersToTrack); + } + + override public int arwGet2DMaxMarkersToTrack() + { + return ARX_pinvoke.arwGetTrackerOptionInt(ARW_TRACKER_OPTION_2D_MAXIMUM_MARKERS_TO_TRACK); + } + override public int arwAddTrackable(string cfg) { return ARX_pinvoke.arwAddTrackable(cfg); diff --git a/Source/Package/ProjectSettings/ProjectSettings.asset b/Source/Package/ProjectSettings/ProjectSettings.asset index cb4a914..a7673d7 100644 --- a/Source/Package/ProjectSettings/ProjectSettings.asset +++ b/Source/Package/ProjectSettings/ProjectSettings.asset @@ -134,7 +134,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 1.1.2 + bundleVersion: 1.1.3 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 diff --git a/artoolkitx-version.txt b/artoolkitx-version.txt index 8428158..9c1218c 100644 --- a/artoolkitx-version.txt +++ b/artoolkitx-version.txt @@ -1 +1 @@ -1.1.2 \ No newline at end of file +1.1.3 \ No newline at end of file