bigbite
Posts: 2
Joined: 26 Jul 2017, 12:02

Re: Microsoft Blend for Visual Studio and Unity workflow

27 Jul 2017, 09:31

Is this still the best way of doing it? If not, what is?

Edit
I've been trying to use this for a couple of days now. I keep getting errors in Unity in regards to all kinds of things. I also find the workflow to be a little on the rough side. I could be missing something. I hope this tool develops a smoother workflow. I also hope that some of the documentation gets more refined/updated.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Microsoft Blend for Visual Studio and Unity workflow

28 Jul 2017, 12:46

Hi! Sorry for the inconveniences, a new version is coming soon with many improvements. We are also aware of the documentation issues and we are working it.

Could you please describe with more detail the errors you are getting and your problems with the workflow?

Thanks!
 
bigbite
Posts: 2
Joined: 26 Jul 2017, 12:02

Re: Microsoft Blend for Visual Studio and Unity workflow

29 Jul 2017, 11:30

Hi! Sorry for the inconveniences, a new version is coming soon with many improvements. We are also aware of the documentation issues and we are working it.

Could you please describe with more detail the errors you are getting and your problems with the workflow?

Thanks!
Thanks for the response.
I started a new project and followed the tutorial as close as I could. I was able to get a UI without errors on the screen (Unity3d), and I'm having a blast. However, there seems to be some issues when you switch between Blend and Unity3d. Sometimes it seems like Noesis forgets to update the contents of the xaml(?), or the xaml asset more specifically, in Unity and throws errors. I have been able to remedy this by forcing a compile on the Unity side. Not sure what to attribute it too.

BTW, I'm no Blend guru so most of this is new to me. It's hard to know how much of I got to do in Blend. For instance; having a storyboard play when a trigger is fired, and said trigger is linked to a button click. I don't believe that transfer over, right? One of the sample projects shows that you have to wire that up on the Unity side. Is there a page on the website that outlines what transfers over from Blend? Thanks in advance!
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Microsoft Blend for Visual Studio and Unity workflow

31 Jul 2017, 16:04

I started a new project and followed the tutorial as close as I could. I was able to get a UI without errors on the screen (Unity3d), and I'm having a blast. However, there seems to be some issues when you switch between Blend and Unity3d. Sometimes it seems like Noesis forgets to update the contents of the xaml(?), or the xaml asset more specifically, in Unity and throws errors. I have been able to remedy this by forcing a compile on the Unity side. Not sure what to attribute it too.
This is really weird, we process the asset (.xaml -> .asset) each time Unity tells us there is a change. There are a few bugs when several XAMLs are changed at the same time. We are fixing all those issues in the next version.
BTW, I'm no Blend guru so most of this is new to me. It's hard to know how much of I got to do in Blend. For instance; having a storyboard play when a trigger is fired, and said trigger is linked to a button click. I don't believe that transfer over, right? One of the sample projects shows that you have to wire that up on the Unity side. Is there a page on the website that outlines what transfers over from Blend? Thanks in advance!
Everything that is stored in the XAML file is transferred from Blend to Unity. So that means, that everything is transferred although consider that we don't 100% support Blend. There are a few features that are still not implemented. But I would say everything you need should be there.

You should take care with code-behind (code in .cs files in Blend) because that is not transferred over automatically (you can find many posts at our forums with suggestions about how to solve this from many of our clients). Please read our Events Tutorial for more information about events in Noesis. In fact, you should read all the tutorials. : )
 
User avatar
jgwinner
Posts: 10
Joined: 21 Jun 2017, 16:29
Contact:

Re: Microsoft Blend for Visual Studio and Unity workflow

16 Aug 2017, 16:42

In our case, as you can see in the samples we are uploading to the Github, we follow the first option exposed by movra: create a Blend project and the directory structure there (BlendProject/Assets/...). As Blend does not allow you to add existing folders to the project, all the files and directories are always created from Blend. And then you can open the Unity project by selecting the BlendProject directory.
I tried that extensively with Visual Studio (not Blend). Either Unity complains that the directory already exists when you try to create it, OR Visual Studio complains that the directory already exists ... it's a chicken and egg situation.

If you VERY carefully look at the beginner tutorial, there are some shenanigans behind the scenes. You carefully indicate that Blend "has to" create the Assets folder - yet, if Blend created the assets folder, why was there a Unity icon at the desktop already? Also, in the video, Unity showed a recently opened project instead of "Create." How did it know there was a Blend project there and that we wanted to open it as a Unity app? I don't think what the video showed was what actually happened.

That's why I posted about the workflow docs. From a person trying to learn Noesis, it's rough. I got it working for a glorius one edit cycle, then Unity refused to open the project. Not quite sure what I did. I later recreated the two projects 4-5 times trying different versions of the chicken and egg :) including 'create the solution,' different names, which was first and which was second, etc.

I eventually settled on creating a completely different Visual Studio project and using "Add existing item" and then using the drop down on the "add" button to link. I am getting errors with Noesis namespaces, haven't quite figured that out yet. I may have to edit visually with one file and manually paste in the XAML, which is really messy.

Starting to wonder if it's worth it, especially as I have to render into a texture for my VR assets. Might as well just use a bit-mapped GUI anyway. No real advantage to Noesis at that point. (sorry, not trying to be rude, just working through my options).

== John ==
 
User avatar
jgwinner
Posts: 10
Joined: 21 Jun 2017, 16:29
Contact:

Re: Microsoft Blend for Visual Studio and Unity workflow

16 Aug 2017, 21:23

And don't get me wrong, Noesis is superb for 2D GUI's!
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Microsoft Blend for Visual Studio and Unity workflow

19 Aug 2017, 21:42

And don't get me wrong, Noesis is superb for 2D GUI's!
Thanks! :)

Just want to point that NoesisGUI implements Silverlight's Projection property, so you can project UI into 3D.

Take a look at the Menu3D demo in GitHub: https://github.com/Noesis/Tutorials/tre ... nu3D/Unity

 
k.halterman13
Posts: 2
Joined: 12 Mar 2017, 06:21

Re: Microsoft Blend for Visual Studio and Unity workflow

09 Feb 2020, 23:23

This is an older post, but relates to my current issues without creating a new thread. I am trying "really hard" to learn XAML and implement Noesis into my project. I am doing okay right now using Unity's UI and my own C# code, but WPF seems to be cleaner and better, especially when trying to reuse elements and styles. I wanted to reverse engineer the samples to try and figure out how everything works, but it is just too much, especially with the 3DMenu project sample that implements multiple pages/windows into one view. This is what I would like to end up with, but just not sure how to do it and get Unity and Noesis to not throw errors (using Blend). If I add a new item to Blend (xaml) which type should I add? The template code seems incompatible with the solution and Noesis with regards to the namespace and ability to reference it from the MainWindow. Should I just stop using Blend and code it all by hand in VS? Lastly, as far as data binding, I tried following the tutorial with a simple label and instantly got errors just trying to make a <DataContext> tag. Is there further documentation on this? I just wanted to see if I could get a simple timer going in an Update() function just to see it work in play mode but cannot seem to find a dumbed-down enough tutorial.
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Microsoft Blend for Visual Studio and Unity workflow

10 Feb 2020, 12:08

Hi, using our project template for Visual Studio as explained in our tutorial: https://www.noesisengine.com/docs/Gui.C ... html#blend, you can create in Blend a basic Unity project that shows you how to bind a ViewModel to the xaml. Basically set the ViewModel in the DataContext property from the MainWindow code-behind. Then use bindings in xaml to connect the ViewModel's data.

The key to not getting errors in Blend is to use #define and #ifdef for parts of the code that are not 100% compatible between WPF and NoesisGUI. You can see that in the generated MainWindow.xaml.cs file.

The kind of items you should add to your Blend project are UserControl, Window items are not supported for Unity.
 
PixelArtDragon
Posts: 4
Joined: 23 Jun 2020, 13:22

Re: Microsoft Blend for Visual Studio and Unity workflow

10 Nov 2020, 16:51

Just wanted to add to this post with one small addition:
If you want to be able to access the Unity API from the code-behind files, you can add the Unity DLLs (located in \Editor\Data\Managed\UnityEngine of the Unity install folder) as references to the WPF project. One thing to pay attention to, though, is that the partial class in Unity (with the Noesis definitions) won't have access to the automatically generated elements, so you'll need to extract them yourself. For example:
public partial class MainView : UserControl {
	public MainView() {
		InitializeComponent();
#if NOESIS
		Button btnNextTurn = this.FindName("btnNextTurn") as Button;
#endif
		btnNextTurn.Click += BtnNextTurn_Click;
	}

	private void BtnNextTurn_Click(object sender, RoutedEventArgs e) {
		Debug.Log("Next Turn");
	}
}

Who is online

Users browsing this forum: Google [Bot], vinick and 59 guests