Hierarchical data with unknown depth itemsControl [UWP] - xaml

I am trying to display a hierarchy of unknown depth in a panel with a itemsControl.
My data model looks like this
Root object
|_ Pegs (Observablelist)
|_ Parts (Observablelist)
|_ Pegs (Observablelist)
|_...
I found this article https://msdn.microsoft.com/sv-se/library/windows/apps/xaml/mt269384.aspx
useful but I don't know how to take then next step and create a DataTemplateSelector that works. I found some old examples with a HierarchicalDataTemplate but that doesn't seem to exists in UWP.
Any ideas?

Related

View selection of objects among layers in adobe illustrator

I am looking for some best practices to sort / group different objects across multiple layers in Adobe Illustrator, to be able to select/view a specific selection of objects.
In more detail:
I have a grafic with multiple versions, which are very common, but yet slightly different, hence I want to edit them in one *.ai file
Same header for all
Specific highlight for version 1/2
3 different languages (EN/DE/ES)
Specific background for version 1/2
To reduce redundancy I want to create common objects only once, instead of creating a group for each version/langugage for simple showing/hiding and duplicate objects.
My current layer/group structure (as minimum example) would be:
1 |_ Header
1.1 |_ HeaderGrafic
2 |_ Highlight
2.1 |_ Higlight_1
2.2 |_ Higlight_2
3 |_ Text
3.1 |_ Text_EN
3.2 |_ Text_DE
3.3 |_ Text_ES
4 |_ Background
4.1 |_ Background_1
4.2 |_ Background_2
I am searching for a quick and easy way to switch views to select a specific combination, e.g.
Version 1 in language EN -> showing only 1.1, 2.1, 3.1, 4.1 and hiding all others
Version 2 in language ES -> showing only 1.1, 2.2, 3.3, 4.1 and hiding all others
I tried storing selections, but cannot get to view/hide specific views/selections.
As for change views it looks like you need the standard commands 'New View', 'Edit Views' in menu 'View':
As for store selections in the same way, well, Illustrator has no such tool as far as I know. Which is yet another example of disgrace of Adobe Illustrator developers. (I can be wrong about latest versions, though).
Of course it can be done with script(s).
Or you can select your objects with actions if you will place object on correct layers. You can lock and unlock the layers with actions (with above mentioned menu commands, as well) and perform the command 'Select All'.

Exploding only some part of an object in Blender 2.82a (using Explode modifier with Vertex Group?)

I am trying to explode/destroy only some part of an object.
Following Blender 2.82 manual page
https://docs.blender.org/manual/en/2.82/physics/particles/emitter/emission.html
says "You may use vertex groups to confine the emission, that is done in the Vertex Groups panel."
So, it must be possible.
As a test, I created a Blender file, attempting to explode/destroy only the left ear of Suzanne, using Explode modifier.
I tried the following:
Added a monkey object ("Suzanne").
Applied "Subdivision Modifier" with "Simple" subdivision algorithm.
Created a vertex group named "VtxGroup_Suzanne__All_vertices_in_left_ear", which contains all vertices in Suzanne's left ear.
enter image description here
Created particle system setting.
Enabled Rotation.
In "Density" field under "Vertex Groups", entered "VtxGroup_Suzanne__All_vertices_in_left_ear".
In "Render As" filed under "Render", chose "Object".
Added "Explode" modifier.
This modifier has "Vertex Group" field, but it seems it does not make any difference in the result (probably because I do not know how to use it properly???)
At this point, when I play the animation, particles erupt out of Suzanne's left ear, breaking down Suzanne little by little.
However, the destruction is not limited to the left year. Entire Suzanne starts breaking down.
Some destruction pieces are really big or unnaturally long, such as almost half of Suzanne's face shown in the screenshot.
enter image description here
Is there any way I can limit the destruction only to the left ear (which is vertex group "VtxGroup_Suzanne__All_vertices_in_left_ear".
Also, can I adjust the sizes of destruction particles, so that some of them would not be too big, nor too long?
I tried setting a whole bunch of settings, but I could not find the solution. Maybe I am attempting this completely wrong? Is there some way to accomplish this in a completely different way?
This test file is found here (zipped):
Test file for Explode modifier with Vertex Group
Thank you in advance for help.
Try splitting the object? If you want to animate the object beforehand, construct the object out of two separate objects grouped, and then ungroup them at or before the keyframe you want them to explode. I hope this helps!
:)

Adding "properties" to objects in a Blender scene

I am just starting my dive into Blender coming mainly from Quake's Radiant. I am trying to research whether it will fit the need I have for a level editor replacement. So with that in mind, here is my question:
What is the best method for creating and storing a set of prefab "entity" objects such as health packs, ammo pickups, and "moveable" objects such that they have a set of "properties" that can be changed within Blender?
I have found this page, but I am still getting lost as to how to integrate them on a per object basis and achieve the desired result:
https://docs.blender.org/manual/en/dev/editors/properties_editor.html
Note: It is not my goal to use the Blender game engine - just attach values to things for me to export to my own engine.
Edit1: Found an article discussing the topic although it seems very outdated:
https://www.gamasutra.com/blogs/IwanGabovitch/20120524/171032/Using_Blender_3D_as_a_3d_map_editor_rather_than_programming_your_own_from_scratch.php
Example:
// entity 105
{
"inv_item" "2"
"inv_name" "#str_02917"
"classname" "item_medkit"
"name" "item_medkit_11"
"origin" "-150 2322 72"
"triggerFirst" "1"
"triggersize" "40"
"rotation" "0.224951 0.97437 0 -0.97437 0.224951 0 0 0 1"
}
While we can manually add custom properties to any object, these are added to the specific object so can be unique to each object.
A better way of integrating new properties is to use bpy.props, these can be added to an objects class in blender, this means every object will have the same properties available.
You can setup a custom panel to edit your properties, like this simple example. Both the properties and panel as well as your object exporter can be defined in an addon which you can have enable at startup so that it is available every time you run blender. An addon also makes it easier for you to share your game editor with others.
The link I found seems to be the best option and allow for the most flexibility. The source code for the Super Tux Kart plugins serve as a great reference implementation:
https://sourceforge.net/p/supertuxkart/code/HEAD/tree/media/trunk/blender_26/

UWP Relativepanel bound to UiElement doesn't work like RelativePanel with propertie = UiElement

We are developing a Windows10 Universal App (UWP). We have huge issues related to how RelativePanel behave depending of syntax and pc.
We have dynamic data response from a web service and we have to display a dynamic structure of UI controls to render the GUI.
We are trying to use RelativePanels with child elements composed of ItemsControls rendering different type of sub data (Addresses, Phones, etc..).
The ItemTemplate of each ItemsControl' item is a Template composed of a RelativePanel.
Now, the weird stuff happened differently between design and runtime.
At design time, when we want to set Target UIElement of the RelativePanel, we can use the following syntax:
Ex: RelativePanel.Below="EntryMobileNumbers" or
Ex: RelativePanel.Below="{Binding ElementName=EntryMobileNumbers}" />
They are supposed to both work but they don't.
For some RelativePanels’ child elements, if we use the first syntax, the xaml designer bugs and display weird error message
about “value must be of type UIElement”.
Looked on forums for this type of Xaml error and it seems for some developers it’s better to use the second syntax with the Binding.
The good side of it is with that the design is not displaying the squigglys and the error BUT the pb is at Run-time;
the result is wrong and some elements are overlapping.
With syntax 2
With syntax 1
We have also different issues between dev pc’s. With the VS2015 Enterprise installed on all pc’s,
some are displaying squigglys or crash the Xaml Designer with Syntax 1 and some are not.
We also tried to update VS2015 with yesterday’s RC1. It fixed the issues on one of the Pc and not on the others.
PS. All samples out there are very simple. I would very happy to see a "real life" application.
Like e.g. Money from the store to see how layout are managed
RelativePanel.Above="{Binding ElementName=SubTitleDesktop}"
instead of
RelativePanel.Above="SubTitleDesktop"
and it will helps you get rid off errors

How do I control polymorph sizes using UITheme builder

I am trying to create a Dominion game in Smalltalk, and I can't get the layout of the GUI the way I want.
Currently, I have this as code to build the GUI:
open: game
| builder content |
builder := UITheme builder.
content := builder
newColumn:
{(builder
newListFor: game
list: #supplyStrings
selected: nil
changeSelected: nil
getEnabled: nil
help: 'Supply') .
(builder newRow: (game players collect: [ :p | self morphForPlayer: p usingBuilder: builder ]))}.
gui := (content openInWindowLabeled: 'DominionGame') extent: 1024 # 768
(forgive the poor Smalltalk style, I've been using Smalltalk for a week).
I am getting the basic idea of what I want: a window with the top portion common to all players, and a bottom portion divided into sections for each player.
The trouble I have is that the top portion is too big, taking up about half the window, and I don't know how to fix that.
I've tried adding "vsizing: #shrinkWrap" to the builder for the #supplyStrings list, but that made it too small, forcing the contents to use a scrollbar; I've tried adding "extent: 1024#200" to that morph, and saw no effect.
So I have two questions:
1) How do I get finer layout control over the objects built with UITheme builder?
2) Where can I find documentation on how to do UI design using Pharo? I'd love to RTFM, if I know where TFM was to R!
You can build an UI at different abstraction levels in Pharo. There is Glamour, where you describe the UI in terms of presentations, panes & ports. It is most useful for building specialized model browsers. For building a game it doesn't seem the most suitable. Then there is Spec, aiming at reuse of composable widgets. That could be a good fit. This summer there has been a GSoC project to build an Spec UIPainter, so you can get a good feel for how to layout the UI. PolyMorph is basically an abstraction layer over Morphic providing different skins (UIThemes). Below that is Morphic. An advantage of building directly in Morphic is that there is an excellent game building example: Laser Game (needing slight changes for use in Pharo).