Skip to content

Commit beeb136

Browse files
Merge pull request #2 from Live2D/develop
Cubism 4 SDK for Java R1 beta1
2 parents f593bda + 9276e46 commit beeb136

37 files changed

+935
-627
lines changed

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,32 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## [4-r.1-alpha.1] - 2022-10-06
7+
## [4-r.1-beta.1] - 2022-12-08
8+
9+
### Added
10+
11+
* Add support for high-precision masks.
12+
* Implement to throw an exception when a user attempt to give null value to a setter method.
13+
* Add API to allow users to configure culling.
14+
* The number of render textures used can now be increased arbitrarily.
15+
* The maximum number of masks when using multiple render textures has been increased to "number of render textures * 32".
16+
17+
### Changed
18+
19+
* Change the visibility of field variables in CubismClippingContext class from private to public and remove the getter and setter methods.
20+
* Change the specification of the logging functions in `CubismDebug` so that they can take a format string as an argument.
21+
22+
### Fixed
23+
24+
* Change `radianToDirection` function in `CubismMath` so that an instance of CubismVector2 created by an API user is given as second argument, and the calculation result is stored in that instance and returned.
25+
* Change the type of cache variables for vertex information used in `doDrawModel` function in `CubismRendererAndroid` and `setupClippingContext` function in `CubismClippingManagerAndroid` from `Map` to array.
26+
* The cost of converting `int` type to `Integer` type (auto-boxing) that was incurred every frame was removed by this change.
27+
* Fix `updateParticles` and `updateParticlesForStabilization` function in `CubismPhysics` not to create an instance of CubismVector2.
28+
29+
## 4-r.1-alpha.1 - 2022-10-06
830

931
### Added
1032

1133
* New released!
34+
35+
[4-r.1-beta.1]: https://github.com/Live2D/CubismJavaFramework/compare/4-r.1-alpha.1...4-r.1-beta.1

README.ja.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Live2D Cubism 4 Editor で出力したモデルをアプリケーションで利
88

99
モデルを表示、操作するための各種機能を提供します。モデルをロードするにはCubism Coreライブラリと組み合わせて使用します。
1010

11-
このリポジトリは**alpha版**となっています。バグ報告やご提案がありましたら、GitHubの機能で[issue](https://github.com/Live2D/CubismJavaFramework/issues)を立てて弊社までお寄せください。
12-
1311
## 対応Javaバージョン
1412

1513
このFrameworkは**Java SE 6**以上でコンパイルが可能です。
@@ -62,7 +60,7 @@ JSON パーサーやログ出力などのユーティリティ機能を提供し
6260

6361
当リポジトリには Live2D Cubism Core for Java は同梱されていません。
6462

65-
ダウンロードするには[こちら](https://creatorsforum.live2d.com/t/topic/1110)のページを参照ください。
63+
ダウンロードするには[こちら](https://www.live2d.com/download/cubism-sdk/download-java/)のページを参照ください。
6664

6765
## サンプル
6866

@@ -78,6 +76,22 @@ JSON パーサーやログ出力などのユーティリティ機能を提供し
7876

7977
当リポジトリの変更履歴については [CHANGELOG.md](CHANGELOG.md) を参照ください。
8078

79+
## プロジェクトへの貢献
80+
81+
プロジェクトに貢献する方法はたくさんあります。バグのログの記録、このGitHubでのプルリクエストの送信、Live2Dコミュニティでの問題の報告と提案の作成です。
82+
83+
### フォークとプルリクエスト
84+
85+
修正、改善、さらには新機能をもたらすかどうかにかかわらず、プルリクエストに感謝します。ただし、ラッパーは可能な限り軽量で浅くなるように設計されているため、バグ修正とメモリ/パフォーマンスの改善のみを行う必要があることに注意してください。メインリポジトリを可能な限りクリーンに保つために、必要に応じて個人用フォークと機能ブランチを作成してください。
86+
87+
### バグ
88+
89+
Live2Dコミュニティでは、問題のレポートと機能リクエストを定期的にチェックしています。バグレポートを提出する前に、Live2Dコミュニティで検索して、問題のレポートまたは機能リクエストがすでに投稿されているかどうかを確認してください。問題がすでに存在する場合は、関連するコメントを追記してください。
90+
91+
### 提案
92+
93+
SDKの将来についてのフィードバックにも関心があります。Live2Dコミュニティで提案や機能のリクエストを送信できます。このプロセスをより効果的にするために、それらをより明確に定義するのに役立つより多くの情報を含めるようお願いしています。
94+
8195
## コミュニティ
8296

8397
ユーザー同士でCubism SDKの活用方法の提案や質問をしたい場合は、是非コミュニティをご活用ください。

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ This is a framework for using models output by Live2D Cubism 4 Editor in applica
88

99
It provides various functions for displaying and manipulating the model. It is used in conjunction with the Cubism Core library to load the model.
1010

11-
This repository is an **alpha version**. If you have any bug reports or suggestions, please send them to us by creating an [issue](https://github.com/Live2D/CubismJavaSamples/issues) using the GitHub feature.
12-
1311
## Supported Java Versions
1412

1513
This framework can be compiled with **Java SE 6** or higher.
@@ -62,7 +60,7 @@ Provides utility functions such as JSON parser and log output.
6260

6361
Live2D Cubism Core for Java is not included in this repository.
6462

65-
To download, please refer to [this](https://community.live2d.com/discussion/1480/download-cubism-sdk-for-java-alpha/) page.
63+
To download, please refer to [this](https://www.live2d.com/download/cubism-sdk/download-java/) page.
6664

6765
## Samples
6866

@@ -78,11 +76,25 @@ Please refer to the following sample repository for implementation examples of s
7876

7977
Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repository.
8078

79+
## Contributing
80+
81+
There are many ways to contribute to the project: logging bugs, submitting pull requests on this GitHub, and reporting issues and making suggestions in Live2D Community.
82+
83+
### Forking And Pull Requests
84+
85+
We very much appreciate your pull requests, whether they bring fixes, improvements, or even new features. Note, however, that the wrapper is designed to be as lightweight and shallow as possible and should therefore only be subject to bug fixes and memory/performance improvements. To keep the main repository as clean as possible, create a personal fork and feature branches there as needed.
86+
87+
### Bugs
88+
89+
We are regularly checking issue-reports and feature requests at Live2D Community. Before filing a bug report, please do a search in Live2D Community to see if the issue-report or feature request has already been posted. If you find your issue already exists, make relevant comments and add your reaction.
90+
91+
### Suggestions
92+
93+
We're also interested in your feedback for the future of the SDK. You can submit a suggestion or feature request at Live2D Community. To make this process more effective, we're asking that you include more information to help define them more clearly.
94+
8195
## Community
8296

8397
If you want to suggest or ask questions about how to use the Cubism SDK between users, please use the community.
8498

8599
- [Live2D community](https://community.live2d.com/)
86100
- [Live2D 公式コミュニティ (Japanese)](https://creatorsforum.live2d.com/)
87-
88-

framework/src/main/java/com/live2d/sdk/cubism/framework/CubismCdiJson.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ private CubismCdiJson(CubismJson json) {
171171
* @return If true, the key exists
172172
*/
173173
private boolean existsParameters() {
174-
// ACubismJsonValue node = json.getRoot().get(JsonKey.PARAMETERS.key);
175-
// return node != null;
176174
ACubismJsonValue node = json.getRoot().get(JsonKey.PARAMETERS.key);
177175
return !node.isNull() && !node.isError();
178176
}
@@ -184,7 +182,6 @@ private boolean existsParameters() {
184182
*/
185183
private boolean existsParameterGroups() {
186184
ACubismJsonValue node = json.getRoot().get(JsonKey.PARAMETER_GROUPS.key);
187-
// return node != null;
188185
return !node.isNull() && !node.isError();
189186
}
190187

@@ -195,7 +192,6 @@ private boolean existsParameterGroups() {
195192
*/
196193
private boolean existsParts() {
197194
ACubismJsonValue node = json.getRoot().get(JsonKey.PARTS.key);
198-
// return node != null;
199195
return !node.isNull() && !node.isError();
200196
}
201197

framework/src/main/java/com/live2d/sdk/cubism/framework/CubismFramework.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public int getId() {
7575
* @param logger log output function
7676
*/
7777
public void setLogFunction(ICubismLogger logger) {
78+
if (logger == null) {
79+
throw new IllegalArgumentException("logger is null.");
80+
}
7881
logFunction = logger;
7982
}
8083

framework/src/main/java/com/live2d/sdk/cubism/framework/CubismModelSettingJson.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
package com.live2d.sdk.cubism.framework;
99

10-
import com.live2d.sdk.cubism.framework.exception.CubismJsonParseException;
1110
import com.live2d.sdk.cubism.framework.id.CubismId;
1211
import com.live2d.sdk.cubism.framework.utils.jsonparser.ACubismJsonValue;
1312
import com.live2d.sdk.cubism.framework.utils.jsonparser.CubismJson;
@@ -22,7 +21,7 @@
2221
* This class deals with model3.json data.
2322
*/
2423
public class CubismModelSettingJson implements ICubismModelSetting {
25-
public CubismModelSettingJson(byte[] buffer) throws CubismJsonParseException {
24+
public CubismModelSettingJson(byte[] buffer) {
2625
CubismJson json;
2726
json = CubismJson.create(buffer);
2827

framework/src/main/java/com/live2d/sdk/cubism/framework/effect/CubismBreath.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -118,29 +118,17 @@ public void updateParameters(CubismModel model, float deltaTimeSeconds) {
118118
* Bind parameters of breath.
119119
*
120120
* @param breathParameters A parameters list bound breath
121+
* @throws IllegalArgumentException if an argument is null
121122
*/
122123
public void setParameters(List<BreathParameterData> breathParameters) {
124+
if (breathParameters == null) {
125+
throw new IllegalArgumentException("breathParameters is null.");
126+
}
127+
123128
this.breathParameters = breathParameters;
124129
areBreathParametersChanged = true;
125130
}
126131

127-
/**
128-
* Get the parameter bound breath at the specified index.
129-
* <p>
130-
* This method returns the copy of the breath parameter.
131-
* </p>
132-
*
133-
* @param index parameter index
134-
* @return BreathParameterData instance(Optional type)
135-
*/
136-
public BreathParameterData getParameter(int index) {
137-
if (index < 0 || index >= breathParameters.size()) {
138-
return null;
139-
}
140-
// return new BreathParameterData(_breathParameters.get(index));
141-
return breathParameters.get(index);
142-
}
143-
144132
/**
145133
* Returns the parameters bound breath.
146134
* <p>

framework/src/main/java/com/live2d/sdk/cubism/framework/effect/CubismEyeBlink.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,13 @@ public void setBlinkingSettings(float closing, float closed, float opening) {
120120
* Set a parameter IDs list to blink.
121121
*
122122
* @param parameterIds A parameter IDs list
123+
* @throws IllegalArgumentException if an argument is null
123124
*/
124125
public void setParameterIds(List<CubismId> parameterIds) {
125-
this.parameterIds = parameterIds;
126-
}
127-
128-
/**
129-
* Get the parameter ID to eye-blink.
130-
* <p>If the ID does not exist at the specified index, or if the parameter list is empty, then empty instance of Optional is returned.
131-
*
132-
* @param index index of the parameter ID
133-
* @return CubismId instance(Optional type)
134-
*/
135-
public CubismId getParameterId(int index) {
136-
if (index < 0 || index >= parameterIds.size()) {
137-
return null;
126+
if (parameterIds == null) {
127+
throw new IllegalArgumentException("parameterIds is null.");
138128
}
139-
140-
return parameterIds.get(index);
129+
this.parameterIds = parameterIds;
141130
}
142131

143132
/**

framework/src/main/java/com/live2d/sdk/cubism/framework/effect/CubismPose.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public static CubismPose create(byte[] pose3json) {
113113
return pose;
114114
}
115115

116-
117116
/**
118117
* Update model's parameters.
119118
*
@@ -393,5 +392,4 @@ private enum JsonTag {
393392
* Previous operated model
394393
*/
395394
private CubismModel lastModel;
396-
397395
}

framework/src/main/java/com/live2d/sdk/cubism/framework/id/CubismId.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ public class CubismId {
1515
* Consturctor
1616
*
1717
* @param id A ID name
18+
* @throws IllegalArgumentException if an argument is null
1819
*/
1920
public CubismId(String id) {
21+
if (id == null) {
22+
throw new IllegalArgumentException("id is null.");
23+
}
2024
this.id = id;
2125
}
2226

0 commit comments

Comments
 (0)