Skip to content

Commit

Permalink
#5532: Add tiling plane test model. Source view is collapsed at the b…
Browse files Browse the repository at this point in the history
…eginning
  • Loading branch information
codereader committed Mar 22, 2021
1 parent 61510a2 commit 0ff2b62
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 2 deletions.
Binary file added install/bitmaps/tiles.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
122 changes: 122 additions & 0 deletions install/resources/preview/tiles.ase
@@ -0,0 +1,122 @@
*3DSMAX_ASCIIEXPORT 200
*COMMENT "DarkRadiant ASCII Scene Export(*.ase)"
*SCENE {
*SCENE_FILENAME "unnamed.map"
*SCENE_FIRSTFRAME 0
*SCENE_LASTFRAME 100
*SCENE_FRAMESPEED 30
*SCENE_TICKSPERFRAME 160
*SCENE_BACKGROUND_STATIC 0.0000 0.0000 0.0000
*SCENE_AMBIENT_STATIC 0.0000 0.0000 0.0000
}
*MATERIAL_LIST {
*MATERIAL_COUNT 1
*MATERIAL 0 {
*MATERIAL_NAME "Plane"
*MATERIAL_CLASS "Standard"
*MATERIAL_AMBIENT 0.5882 0.5882 0.5882
*MATERIAL_DIFFUSE 0.5882 0.5882 0.5882
*MATERIAL_SPECULAR 0.9000 0.9000 0.9000
*MATERIAL_SHINE 0.1000
*MATERIAL_SHINESTRENGTH 0.0000
*MATERIAL_TRANSPARENCY 0.0000
*MATERIAL_WIRESIZE 1.0000
*MATERIAL_SHADING Blinn
*MATERIAL_XP_FALLOFF 0.0000
*MATERIAL_SELFILLUM 0.0000
*MATERIAL_FALLOFF In
*MATERIAL_XP_TYPE Filter
*MAP_DIFFUSE {
*MAP_NAME "Plane"
*MAP_CLASS "Bitmap"
*MAP_SUBNO 1
*MAP_AMOUNT 1.0000
*BITMAP "\\base\material"
*MAP_TYPE Screen
*UVW_U_OFFSET 0.0000
*UVW_V_OFFSET 0.0000
*UVW_U_TILING 1.0000
*UVW_V_TILING 1.0000
*UVW_ANGLE 0.0000
*UVW_BLUR 1.0000
*UVW_BLUR_OFFSET 0.0000
*UVW_NOUSE_AMT 1.0000
*UVW_NOISE_SIZE 1.0000
*UVW_NOISE_LEVEL 1
*UVW_NOISE_PHASE 0.0000
*BITMAP_FILTER Pyramidal
}
}
}
*GEOMOBJECT {
*NODE_NAME "mesh0"
*NODE_TM {
*NODE_NAME "mesh0"
*INHERIT_POS 0 0 0
*INHERIT_ROT 0 0 0
*INHERIT_SCL 0 0 0
*TM_ROW0 1.0000 0.0000 0.0000
*TM_ROW1 0.0000 1.0000 0.0000
*TM_ROW2 0.0000 0.0000 1.0000
*TM_ROW3 0.0000 0.0000 0.0000
*TM_POS 0.0000 0.0000 0.0000
*TM_ROTAXIS 0.0000 0.0000 0.0000
*TM_ROTANGLE 0.0000
*TM_SCALE 1.0000 1.0000 1.0000
*TM_SCALEAXIS 0.0000 0.0000 0.0000
*TM_SCALEAXISANG 0.0000
}
*MESH {
*TIMEVALUE 0
*MESH_NUMVERTEX 4
*MESH_NUMFACES 2
*MESH_VERTEX_LIST {
*MESH_VERTEX 0 -105.781 -116 -21.7808
*MESH_VERTEX 1 105.781 -116 21.7808
*MESH_VERTEX 2 -105.781 116 -21.7808
*MESH_VERTEX 3 105.781 116 21.7808
}
*MESH_FACE_LIST {
*MESH_FACE 0: A: 0 B: 1 C: 2 AB: 0 BC: 0 CA: 0 *MESH_SMOOTHING 1 *MESH_MTLID 0
*MESH_FACE 1: A: 1 B: 3 C: 2 AB: 0 BC: 0 CA: 0 *MESH_SMOOTHING 1 *MESH_MTLID 0
}
*MESH_NUMTVERTEX 4
*MESH_TVERTLIST {
*MESH_TVERT 0 0 -0 0.0000
*MESH_TVERT 1 3 -0 0.0000
*MESH_TVERT 2 0 -3 0.0000
*MESH_TVERT 3 3 -3 0.0000
}
*MESH_NUMTVFACES 2
*MESH_TFACELIST {
*MESH_TFACE 0 0 1 2
*MESH_TFACE 1 1 3 2
}
*MESH_NUMCVERTEX 4
*MESH_CVERTLIST {
*MESH_VERTCOL 0 1 1 1
*MESH_VERTCOL 1 1 1 1
*MESH_VERTCOL 2 1 1 1
*MESH_VERTCOL 3 1 1 1
}
*MESH_NUMCVFACES 2
*MESH_CFACELIST {
*MESH_CFACE 0 0 1 2
*MESH_CFACE 1 1 3 2
}
*MESH_NORMALS {
*MESH_FACENORMAL 0 -0.201674 0 0.979453
*MESH_VERTEXNORMAL 0 -0.201674 0 0.979453
*MESH_VERTEXNORMAL 1 -0.201674 0 0.979453
*MESH_VERTEXNORMAL 2 -0.201674 0 0.979453
*MESH_FACENORMAL 1 -0.201674 0 0.979453
*MESH_VERTEXNORMAL 1 -0.201674 0 0.979453
*MESH_VERTEXNORMAL 3 -0.201674 0 0.979453
*MESH_VERTEXNORMAL 2 -0.201674 0 0.979453
}
}
*PROP_MOTIONBLUR 0
*PROP_CASTSHADOW 1
*PROP_RECVSHADOW 1
*MATERIAL_REF 0
}
2 changes: 1 addition & 1 deletion radiant/ui/materials/MaterialEditor.cpp
Expand Up @@ -160,7 +160,7 @@ MaterialEditor::MaterialEditor() :
auto paneSizer = new wxBoxSizer(wxVERTICAL);
paneSizer->Add(_sourceView, 1, wxGROW | wxEXPAND);
sourceTextPanel->GetPane()->SetSizer(paneSizer);
sourceTextPanel->Expand();
sourceTextPanel->Collapse();

previewPanel->GetSizer()->Add(_preview->getWidget(), 1, wxEXPAND);
previewPanel->GetSizer()->Add(sourceTextPanel, 0, wxEXPAND);
Expand Down
10 changes: 9 additions & 1 deletion radiant/ui/materials/MaterialPreview.cpp
Expand Up @@ -65,8 +65,12 @@ void MaterialPreview::setupToolbar()
_testModelSphereButton = toolbar->AddRadioTool(wxID_ANY, "", wxutil::GetLocalBitmap("sphere.png", wxART_TOOLBAR));
_testModelSphereButton->SetShortHelp(_("Show Sphere"));

_testModelTilesButton = toolbar->AddRadioTool(wxID_ANY, "", wxutil::GetLocalBitmap("tiles.png", wxART_TOOLBAR));
_testModelTilesButton->SetShortHelp(_("Show Tiles"));

toolbar->Bind(wxEVT_TOOL, &MaterialPreview::onTestModelSelectionChanged, this, _testModelCubeButton->GetId());
toolbar->Bind(wxEVT_TOOL, &MaterialPreview::onTestModelSelectionChanged, this, _testModelSphereButton->GetId());
toolbar->Bind(wxEVT_TOOL, &MaterialPreview::onTestModelSelectionChanged, this, _testModelTilesButton->GetId());

toolbar->Realize();

Expand Down Expand Up @@ -251,10 +255,14 @@ void MaterialPreview::setupTestModel()
{
_model = GlobalModelCache().getModelNodeForStaticResource("preview/cube.ase");
}
else // sphere
else if (_testModelSphereButton->IsToggled()) // sphere
{
_model = GlobalModelCache().getModelNodeForStaticResource("preview/sphere.ase");
}
else // Tiles
{
_model = GlobalModelCache().getModelNodeForStaticResource("preview/tiles.ase");
}

// The test model is a child of this entity
_entity->addChildNode(_model);
Expand Down
1 change: 1 addition & 0 deletions radiant/ui/materials/MaterialPreview.h
Expand Up @@ -31,6 +31,7 @@ class MaterialPreview :

wxToolBarToolBase* _testModelCubeButton;
wxToolBarToolBase* _testModelSphereButton;
wxToolBarToolBase* _testModelTilesButton;

public:
MaterialPreview(wxWindow* parent);
Expand Down

0 comments on commit 0ff2b62

Please sign in to comment.