Does "Blend Shape.Key 1" has Property name? - c#

I am trying to animate object with blender shape keys in it thru script. And for that I need to have property name that goes here in my script:
clip.SetCurve("", typeof(SkinnedMeshRenderer), "__________", curve);
After typeof(SkinnedMeshRenderer) there is a blank spot "_________" and there needs to be a property name of Bland Shape.Key 1. Does anybody knows whats the name for it or odes it exist overall? Thanks in advance...

Related

How to add image according to a condition on SQL table

I'm working on a personal project
I have a windows form c# where I add people with a field where I choose the gender and name of the person.
When I click on the button, it adds a person to the table person of human database.
Then on another form I want to display the panel of all the people present in the database.
Display of the persons will be represented by a picture of male/female symbol
I have a person table, with name and gender attributes. And I would like that each time I add a person, automatically according to the gender of the person, a picture of symbol of a woman or a man is added to the table.
The final goal, like I said it before, is to display in a separate picturebox (Windows form C#) each of the persons in the table with their appropriate image(according to gender).
And I'll add a hover option on each picturebox thats shows name of the person when you use your mouse (I dont need help here, just to let you know how it will works).
I don't know either, if it's the right way to approach this problem or if the solution is more on the c# side with a condition on the image display (it seems much more complex to me).
Do I need to create another SQL table named picture and I link it with person but here again, I don't know how i can implement the image condition between picture and person table and make it works with C# form
SQL script:
CREATE TABLE persons(
id INT(100) auto increment, PRIMARY KEY,
name VARCHAR(1000),
gender VARCHAR(7)
);
Here arepictures of how it will looks...
Add form
Panel
I hope I made myself clear, thanks!
If the images are static i.e. They don't change when the user change and all males have the same picture and all the females have the same picture
I think it is not a good idea to put the image in the database. From the C# side you can check if the user is a male or a female and load it from some resources folder in your C# project.
Let me know if I got something wrong with your thoughts.

How to get Cube Data Source View Last Schema Update value

SQL Server Analysis Services
Is there a way to get the data source view last schema update value as seen on the properties dialog box?
If I use the DMV syntax:
SELECT * FROM $System.MDSCHEMA_CUBES
It will list all the measures and dimensions used in the cube database which shows details the same as right clicking the measure or dimension and selecting properties. But, this query does not include the properties for data source or data source view.
Thanks in advance!
Regards and Thanks,
Willie P
P.S. The main reason why I need to get the Last Schema Update for data source view, measures and dimension is to determine if a particular cube element was customized/modified by the client so that if we have to deploy an update to the cube, we have an option to update a particular cube element or not just by getting the Last Schema Update.
If this is not possible using SSAS DMV's, maybe a C# sample program will do.

DataGridView column aligment

I use Visual-Studio-2012. Basically I have 5 column DataGridView with product,quantity,price,+,- and I would like to align all text of products I put into my basket as MiddleCentered except actual Product description (it stays MiddleLeft as default).
I can change aligment via RowHeadersDefaultCellStyle, but I can't choose which columns I would like to align and it makes all of them MiddleCentered.
Is there any way to do so? I was trying to search on the NET, but didn't find anything clear. Help would be very appreciated.
As you have not posted your code, here is a way to aligning the text,
dataGridView1.Columns["ColumnName"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
Give a try and if you still not able to align the text, please post your code.
Holly spirit, I found the answer. I can change it via Edit Columns, selecting column and changing aligment. How stupid do I feel now. Damn...Sorry to bother guys.

Custom info about FrameworkElement

I'm creating a paint simular program. I Draw System.Windows.Shapes, to a canvas in a UserControl. However I Can name my shapes using the Line l = new Line; l.Name Now I would Like to add more than one name to this Line l, Maybe 10 diffrent names. How can I do this? I Have had some ideas but they are all very complicated.
Maybe I was a bit unclear. Example. l.Name = "name_1"; l.Name2 = "material2"; I need to be able to tie my FrameworkElement with these other names. However I don't need to be able to find an FrameworkElement with these other names.
The ideas that I have came up with is very complicated. One of those is to put the FrameworkElement Name to ID_xxxx, and print this ID to a textfile and then add more information about this ID in this text file. Then to read this I Will read lines between etc ID_1 and ID_2 and then figure out what "material" ID_1 is. This feels very complicated and stupid, so I figured StackOverflow might have some suggestions for me.
Thanks Mikael Törnqvist

using visio to automate drawing diagram with c# - can't set custom properties

I have data I am grabbing from a database, and I want to use those values to populate properties on shapes on a visio diagram. I open my own template, and display shapes on the sheet with no problem. My server icon has custom properties such as "manufacturer", "network", etc. When I print out the custom properties for each shape, I get the following output:
Shape = server Label = Manufacturer Value = 0
etc. This is all correct since I haven't set any values yet. When I go to set the values, using the code in the Visio 2003 SDK (SettingACustomProperty.cs) I get an error that "this shape does not have a custom property with the universal name of Manufacturer" - yet printing out the custom properties clearly shows it does (as does looking at the shapeSheet once the shape is drawn in Visio). I've inserted to how I call SettingACustomProperty. Can someone help me figure out what I need to do to insert values into my custom properties on a shape?
Here is how I am calling the code (for testing purposes I have inserted strings myself):
string keyword = "Manufacturer";
string manuValue = "\"Dell\"";
string three = SettingACustomProperty.SetCustomPropertyFormula(visioStarShape, keyword, manuValue);
Visio custom properties have three different concepts which can be considered a name.
The first is the label. This is what you generally see in the user interface and is stored in the label cell in the custom property row in the shapesheet. The label is generally not used to access the custom property programmatically.
The second is the row name. This is the name you will see when looking at the custom property row in the shapesheet. It will appear to before the other cells in the row and be prefixed with "Prop." This is the accessed through automaton using the Name property of the custom property row .
The final row name is the universal name. The universal name exists primarily to allow code find specific Visio objects by name even after the name has been changes when the object is localized, i.e. the name have been translated. The universal name can be accessed using the NameU property of the custom property row. To learn more about universal names see Using Universal Names and Syntax to Localize Your Visio Solutions
When you call SetCustomPropertyFormula the second argument must be the universal name. This is because internally SetCustomPropertyFormula uses get_CellsU which finds a custom property cell using the universal name of the row. I suspect that you are either using the label or the row name, not the universal name, when calling SetCustomPropertyFormula.
If you are using the label you need to switch to using the universal name.
If you are using the name then it no longer matches the universal name. This may happen is some circumstances when you rename the row. You could find out the universal name and then use it in your code. The VBA immediate window is often an easy way to get the NameU property of a row. Alternatively you could update the shape or the master it was instantiated from to set the NameU property equal to the Name property and then you will avoid this confusion (until you rename the row).
Kathy: You can find out the name you need to use
Debug.Print visioStarShape.Section(visSectionProp).Row(0).NameU
Add "Prop." before this name to use it in your code.
Alternatively, with the shape selected, you can show the ShapeSheet by clicking this button in the developer toolbox
You see something like this. Look for the Custom Properties section where you see the labels and the name of your properties:
Then, you use this name to refer to the property (that's your keyword string).
keyword = """Prop.CustProp1"""
or....
keyword = "\"Prop.CustProp1"\"
Still, you don't need the SettingACustomProperty.cs file, since you can reference all the cells in the shape's sheet from your VBA code.
It is possible for you to get or set the formula in them.
See if this serves your purpose. It is an answer I've just posted in Office Techcenter: http://social.technet.microsoft.com/Forums/office/en-US/c837db4c-b90c-4500-b8ae-8d36efca44b6/can-i-apply-custom-property-sets-from-vba-in-visio-2003
Since my system is spanish, I've changed the stencil's and master's names by guess. But the important methods are AddSection, AddNamedRow and especially for you the .Formula one (FormulaForce is the same, but it works even with cells protected with the GUARD function).
Good luck. I'm in love with Visio 2003 (I wish my company had bought Visio 2010, though) :D
'Set the value for the property: vsoShape is an object referencing the shape
vsoShape.Cells("Prop.CustProp1").FormulaU = """Hello"""
vsoShape.Cells("Prop.CustProp2").FormulaU = 2556
The type of CustProp1 is string, and that of CustProp2 is number.
Regards,

Categories