Skip to content

Commit 1a2a97f

Browse files
committed
Реализация редактирования свойств и действий над структурой дерева.
1 parent a8f5f69 commit 1a2a97f

33 files changed

+1480
-46
lines changed

resources/messages/messages.properties

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,20 @@ ModelFileEditorNoSky=No sky
7676
ModelFileEditorFastSky=Fast sky
7777
ModelFileEditorNodeTree=Structure
7878
ModelFileEditorProperties=Properties
79-
ModelFileEditorNodeMesh=Mesh
79+
ModelFileEditorNodeMesh=Mesh
80+
81+
ModelNodeTreeActionMikktspaceTangentGenerator=Generate tangents
82+
ModelNodeTreeActionRemove=Remove
83+
ModelNodeTreeActionRename=Rename
84+
ModelNodeTreeActionOptimizeGeometry=Optimize geometry
85+
ModelNodeTreeActionTools=Tools
86+
87+
ModelPropertyCullHint=Cull Hint
88+
ModelPropertyShadowMode=Shadow mode
89+
ModelPropertyQueueBucket=Queue bucket
90+
ModelPropertyLocation=Location
91+
ModelPropertyScale=Scale
92+
ModelPropertyRotation=Rotation
93+
ModelPropertyMaterial=Material
94+
95+
MaterialModelPropertyControlNoMaterial=No material

resources/messages/messages_ru.properties

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,19 @@ ModelFileEditorFastSky=Быстрый фон
7777
ModelFileEditorNodeTree=Структура
7878
ModelFileEditorProperties=Свойства
7979
ModelFileEditorNodeMesh=Сетка
80+
81+
ModelNodeTreeActionMikktspaceTangentGenerator=Сгенерировать тангенты
82+
ModelNodeTreeActionRemove=Удалить
83+
ModelNodeTreeActionRename=Переименовать
84+
ModelNodeTreeActionOptimizeGeometry=Оптимизировать геометрию
85+
ModelNodeTreeActionTools=Инструменты
86+
87+
ModelPropertyCullHint=Cull Hint
88+
ModelPropertyShadowMode=Режим теней
89+
ModelPropertyQueueBucket=Порядок рендера
90+
ModelPropertyLocation=Положение
91+
ModelPropertyScale=Маштаб
92+
ModelPropertyRotation=Вращение
93+
ModelPropertyMaterial=Материал
94+
95+
MaterialModelPropertyControlNoMaterial=Материал отсутствует

resources/ui/css/custom_classes.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
-fx-background-color: transparent;
5050
-fx-background-insets: 0;
5151
-fx-border-color: transparent;
52-
-fx-padding: 0;
52+
-fx-padding: -5;
5353
-fx-effect: null;
5454
}
5555

5656
.transparent-tree-view:focused {
5757
-fx-background-color: transparent;
5858
-fx-background-insets: 0;
5959
-fx-border-color: transparent;
60-
-fx-padding: 0;
60+
-fx-padding: -5;
6161
-fx-effect: null;
6262
}
6363

@@ -114,8 +114,6 @@
114114
-fx-border-width: 0;
115115
}
116116

117-
118-
119117
/* Transparent TreeCell */
120118

121119
.transparent-tree-cell {
@@ -230,4 +228,8 @@
230228

231229
.material-param-control {
232230
-fx-alignment: center-left;
231+
}
232+
233+
.model-param-control {
234+
-fx-alignment: center-left;
233235
}

resources/ui/css/custom_ids.css

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,68 @@
310310
-fx-pref-height: -fx-min-height;
311311
-fx-max-height: -fx-min-height;
312312
-fx-background: -fx-color-A200;
313+
}
314+
315+
#ModelParamControlSplitLine {
316+
-fx-stroke: -fx-color-500;
317+
-fx-stroke-width: 2;
318+
}
319+
320+
#ModelParamControlParamName {
321+
-fx-min-height: 24;
322+
-fx-pref-height: -fx-min-height;
323+
-fx-max-height: -fx-min-height;
324+
-fx-alignment: center;
325+
-fx-text-alignment: center;
326+
}
327+
328+
#ModelParamControlParamNameSingleRow {
329+
-fx-min-height: 24;
330+
-fx-pref-height: -fx-min-height;
331+
-fx-max-height: -fx-min-height;
332+
-fx-min-width: 140;
333+
-fx-pref-width: -fx-min-width;
334+
-fx-max-width: -fx-min-width;
335+
-fx-alignment: center-right;
336+
}
337+
338+
#ModelParamControlNumberLabel {
339+
-fx-min-height: 24;
340+
-fx-pref-height: -fx-min-height;
341+
-fx-max-height: -fx-min-height;
342+
}
343+
344+
#ModelParamControlNumberField {
345+
-fx-min-height: 24;
346+
-fx-pref-height: -fx-min-height;
347+
-fx-max-height: -fx-min-height;
348+
-fx-min-width: 50;
349+
-fx-pref-width: -fx-min-width;
350+
-fx-max-width: -fx-min-width;
351+
}
352+
353+
#ModelParamControlComboBox {
354+
-fx-min-height: 24;
355+
-fx-pref-height: -fx-min-height;
356+
-fx-max-height: -fx-min-height;
357+
}
358+
359+
#ModelParamControlMaterialLabel {
360+
-fx-min-height: 24;
361+
-fx-pref-height: -fx-min-height;
362+
-fx-max-height: -fx-min-height;
363+
-fx-min-width: 225;
364+
-fx-pref-width: -fx-min-width;
365+
-fx-max-width: -fx-min-width;
366+
-fx-alignment: center-left;
367+
-fx-text-alignment: left;
368+
}
369+
370+
#ModelParamControlMaterialButton {
371+
-fx-min-height: 24;
372+
-fx-pref-height: -fx-min-height;
373+
-fx-max-height: -fx-min-height;
374+
-fx-min-width: 24;
375+
-fx-pref-width: -fx-min-width;
376+
-fx-max-width: -fx-min-width;
313377
}
466 Bytes
Loading
502 Bytes
Loading

src/com/ss/editor/Editor.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,11 @@ public void simpleInitApp() {
268268
InitializeManager.register(FileIconManager.class);
269269
InitializeManager.initialize();
270270

271-
environmentCamera = new EnvironmentCamera(64, new Vector3f(0, 0, 0));
271+
if(Config.ENABLE_PBR) {
272+
environmentCamera = new EnvironmentCamera(64, new Vector3f(0, 0, 0));
273+
stateManager.attach(environmentCamera);
274+
}
272275

273-
stateManager.attach(environmentCamera);
274276
fxContainer = JmeFxContainer.install(this, guiNode, true, cursorDisplayProvider);
275277
scene = EditorFXSceneBuilder.build(fxContainer);
276278

@@ -337,6 +339,7 @@ public void update() {
337339
System.exit(1);
338340
} catch (final IllegalStateException e) {
339341
LOGGER.warning(e);
342+
System.exit(0);
340343
} finally {
341344
syncUnlock(stamp);
342345
}
@@ -359,6 +362,10 @@ private void createProbe() {
359362

360363
final EnvironmentCamera environmentCamera = getEnvironmentCamera();
361364

365+
if(environmentCamera == null) {
366+
return;
367+
}
368+
362369
if (environmentCamera.getApplication() == null) {
363370
final EditorThreadExecutor gameThreadExecutor = EditorThreadExecutor.getInstance();
364371
gameThreadExecutor.addToExecute(this::createProbe);
@@ -373,7 +380,15 @@ private void createProbe() {
373380
* Обновить пробу окружения.
374381
*/
375382
public void updateProbe(final JobProgressAdapter<LightProbe> progressAdapter) {
376-
LightProbeFactory.updateProbe(getLightProbe(), getEnvironmentCamera(), rootNode, progressAdapter);
383+
384+
final LightProbe lightProbe = getLightProbe();
385+
386+
if(lightProbe == null) {
387+
progressAdapter.done(null);
388+
return;
389+
}
390+
391+
LightProbeFactory.updateProbe(lightProbe, getEnvironmentCamera(), rootNode, progressAdapter);
377392
}
378393

379394
/**

src/com/ss/editor/Messages.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,22 @@ public class Messages {
9090
public static final String MODEL_FILE_EDITOR_PROPERTIES;
9191
public static final String MODEL_FILE_EDITOR_NODE_MESH;
9292

93+
public static final String MODEL_NODE_TREE_ACTION_MIKKTSPACE_TANGENT_GENERATOR;
94+
public static final String MODEL_NODE_TREE_ACTION_REMOVE;
95+
public static final String MODEL_NODE_TREE_ACTION_RENAME;
96+
public static final String MODEL_NODE_TREE_ACTION_OPTIMIZE_GEOMETRY;
97+
public static final String MODEL_NODE_TREE_ACTION_TOOLS;
98+
99+
public static final String MODEL_PROPERTY_CULL_HINT;
100+
public static final String MODEL_PROPERTY_SHADOW_MODE;
101+
public static final String MODEL_PROPERTY_QUEUE_BUCKET;
102+
public static final String MODEL_PROPERTY_LOCATION;
103+
public static final String MODEL_PROPERTY_SCALE;
104+
public static final String MODEL_PROPERTY_ROTATION;
105+
public static final String MODEL_PROPERTY_MATERIAL;
106+
107+
public static final String MATERIAL_MODEL_PROPERTY_CONTROL_NO_MATERIAL;
108+
93109
static {
94110

95111
final ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_NAME, ResourceControl.getInstance());
@@ -173,5 +189,21 @@ public class Messages {
173189
MODEL_FILE_EDITOR_NODE_TREE = bundle.getString("ModelFileEditorNodeTree");
174190
MODEL_FILE_EDITOR_PROPERTIES = bundle.getString("ModelFileEditorProperties");
175191
MODEL_FILE_EDITOR_NODE_MESH = bundle.getString("ModelFileEditorNodeMesh");
192+
193+
MODEL_NODE_TREE_ACTION_MIKKTSPACE_TANGENT_GENERATOR = bundle.getString("ModelNodeTreeActionMikktspaceTangentGenerator");
194+
MODEL_NODE_TREE_ACTION_REMOVE = bundle.getString("ModelNodeTreeActionRemove");
195+
MODEL_NODE_TREE_ACTION_RENAME = bundle.getString("ModelNodeTreeActionRename");
196+
MODEL_NODE_TREE_ACTION_OPTIMIZE_GEOMETRY = bundle.getString("ModelNodeTreeActionOptimizeGeometry");
197+
MODEL_NODE_TREE_ACTION_TOOLS = bundle.getString("ModelNodeTreeActionTools");
198+
199+
MODEL_PROPERTY_CULL_HINT = bundle.getString("ModelPropertyCullHint");
200+
MODEL_PROPERTY_SHADOW_MODE = bundle.getString("ModelPropertyShadowMode");
201+
MODEL_PROPERTY_QUEUE_BUCKET = bundle.getString("ModelPropertyQueueBucket");
202+
MODEL_PROPERTY_LOCATION = bundle.getString("ModelPropertyLocation");
203+
MODEL_PROPERTY_SCALE = bundle.getString("ModelPropertyScale");
204+
MODEL_PROPERTY_ROTATION = bundle.getString("ModelPropertyRotation");
205+
MODEL_PROPERTY_MATERIAL = bundle.getString("ModelPropertyMaterial");
206+
207+
MATERIAL_MODEL_PROPERTY_CONTROL_NO_MATERIAL = bundle.getString("MaterialModelPropertyControlNoMaterial");
176208
}
177209
}

src/com/ss/editor/config/Config.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ public abstract class Config {
2929
*/
3030
public static final boolean DEV_DEBUG;
3131

32+
/**
33+
* Активация PBR.
34+
*/
35+
public static final boolean ENABLE_PBR;
36+
3237
static {
3338

3439
final VarTable vars = new DocumentConfig(EditorUtil.getInputStream(CONFIG_RESOURCE_PATH)).parse();
3540

3641
DEV_DEBUG = vars.getBoolean("Dev.debug", false);
42+
ENABLE_PBR = vars.getBoolean("Graphics.enablePBR", false);
3743

3844
PROJECT_PATH = Util.getRootFolderFromClass(Editor.class).toString();
3945
}

src/com/ss/editor/ui/Icons.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public interface Icons {
1919
public static final Image NODE_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/node.png");
2020
public static final Image GEOMETRY_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/geometry.png");
2121
public static final Image MESH_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/mesh.png");
22+
public static final Image EDIT_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/edit.png");
2223

2324
public static final Image REFRESH_18 = ICON_MANAGER.getImage("/ui/icons/actions/18/refresh.png");
2425
public static final Image REMOVE_18 = ICON_MANAGER.getImage("/ui/icons/actions/18/remove.png");
@@ -33,6 +34,7 @@ public interface Icons {
3334
public static final Image PLANE_24 = ICON_MANAGER.getImage("/ui/icons/actions/24/plane.png");
3435
public static final Image ADD_CIRCLE_24 = ICON_MANAGER.getImage("/ui/icons/actions/24/add_circle.png");
3536
public static final Image IMAGE_24 = ICON_MANAGER.getImage("/ui/icons/actions/24/image.png");
37+
public static final Image EDIT_24 = ICON_MANAGER.getImage("/ui/icons/actions/24/edit.png");
3638

3739
public static final Image IMAGE_512 = ICON_MANAGER.getImage("/ui/icons/512/image.png");
3840
}

0 commit comments

Comments
 (0)