How to Share new SteamVR ActionSets and Bindings between Unity Projects - unity3d

I'm developing a VR module in Unity that I hope to be able to import into any of my unity projects as an asset package. This package requires defining input from a Vive controller button to turn it on during gameplay. I would like to somehow share this actionset and button binding between projects so I don't have to manually create the actions and bindings each time I would like to use it.
Is there any way to share SteamVR input settings between projects? Specifically one whole input actionset, and its associated controller bindings.
I've tried exporting the SteamVR_Input folder as a package, also tried with including SteamVR folder, neither worked. After reimport, I can see the imported actionset in the project folder in the SteamVR_Input folder, but it isn't showing up in the input window (Window Menu -> SteamVr Input). However, the live input view shows the actions in the list, but doesn't register any button presses.

Update Unity 2019.2:
This seems to be fixed now.
In the source project, go to SteamVR Input window, click advanced.
Create a partial bindings folder. Rename it to what you want. Note that it will automatically add a SteamVR_ prefix. So my default name had SteamVR_SteamVR_ at the start. I needed to delete the suggested name and just name it my project's name.
It creates it in the base folder for your project, NOT the assets folder for some reason.
In Windows Explorer, drag it into Assets folder of source project.
In Unity editor (source project) it should now prompt you to import settings, but it detects that these actions already exist. Click Merge.
Make sure your actionset is still there in SteamVR input window.
Now you can export a unitypackage from this folder.
Now you can import the unitypackage in the destination project, and it should prompt you after import to load the actions! Yay.
Note: I ran into an issue if I renamed the partial bindings folder after creation. It would not recognize it as actions anymore and not prompt to import. To rename the partial bindings folder, you need to recreate it and follow the above steps again.
OLD ANSWER (outdated) :
Note: this answer is working based on a Beta version of the SteamVR plugin 2.2b4. It may change in a future release
Ok I got this working. It's still not quite possible as far as I can tell to create a unitypackage with the bindings and actions inside, but it's much better than before.
To move an ActionSet and bindings from project 1 to project 2:
In the first project: Create a new action set with your desired actions and bindings.
Go to Window Menu > SteamVR input
click Advanced settings, then click Create. This will create a folder in your project somewhere.
This is where the problem is. This folder can't seem to be packaged. BUT:
Important: In your 2nd project delete the SteamVR_Input folder (you may want to back it up just in case)
Drag this created folder from the 1st project (from windows explorer) into the Assets folder in the project view of the 2nd project (open in Unity). If you do this outside of unity it will not work.
It will prompt you to import the "partial bindings" and will add your custom ActionSet to this other project. Open Window Menu > SteamVR_Input in the 2nd project and then you should see your imported ActionSet at the top. Click "Save and Generate" to recreate a new SteamVR_Input Folder for this project.
Voila! It should work.
I haven't got it to be able to be packaged in an asset package yet.

After spending a lot of frustrating hours I discovered the following simple procedure.
(In Unity 2019.1.14f1 and I suspect it will work in higher versions as well).
In project 1:
It is crucial after editing your bindings in the SteamVR graphical interface to choose
Replace Default Binding
The result of this is that your bindings are completely saved in
Assets/StreamingAssets/SteamVR
(by default, but this is a perfectly good location)
This by the way, is also required if you want to use your bindings in a standalone build.
In project 2:
Copy, via the file system or via export and import custom package, the StreamingAssets/SteamVR folder from project 1 to the corresponding location in project 2.
As of that moment your bindings are available in project2!

Related

Packages folder is empty?

My entire project runs fine, but I'm trying to install and work with URP. I need to grab something from its Packages subfolder, but my entire project's Packages folder is entirely empty. Am I doing something wrong?
It might just be the visibility toggle that's in "hide immutable mode".
All recent Unity versions hide Packages that are imported in an immutable way. In the Project View though there's an icon that tells how many items are hidden (or that could be hidden because immutable and currently visible) and a barred eye. Clicking that toggles the visibility of such items.
Imported packages can be found at Library/PackageCache. If you need to modify an asset from a package, you can move that package to Packages folder via file explorer.

Eclipse to IntelliJ transfer

I have copied my src package structure from eclipse to intellij and it makes this structure within src folder:
How do I make it dz1.drugi so I can one click expand all to my classes?
Another question is how to select default project folder as it is "workspace" at \Users\{Name} for eclipse. Right now, when I create new project like this:
it saves it without workspace (or projects folder) at \Users\{Name}.
Click on the cog icon at the top-right of the explorer view, and check the "Flatten packages" option.
That said, If you get used to keyboard shortcuts top open classes and files, and navigate through recently opened files, you'll quickly see that you'll amost never use the explorer view anymore.
Project view has an option to compact empty middle packages, enable it. You can also use Flatten packages option. Actually, your question is a duplicate of this one.
IntelliJ IDEA remembers the last location you've used when creating a new project. Once you want to create another project, the location one level upper of the previous project directory would be suggested. So, create a project in C:\Users\someuser\workspace\myproject1 and IDE will suggest C:\Users\someuser\workspace\myproject2 for your new myproject2.

Importing a java source file in netbeans

I have a project made, but I had to copy and move the java source file to another location in our clear case. If I want that file to be changed when I make further changes how would I do that? It is now a new name so I will probably have to make a new project but I'm not sure how to just import that one source file into the new project or even the existing project.
Update:
I have a project with a package that has some classes in it. I moved the java source file somewhere else and now need to use that file in that location instead of the original. I created a new project and imported the source file. Now it doesn't recognize the package or the class. Its says class "example" is public, should be declared in a file named "example". And the package error says "incorrect package". I'm not sure how to fix this to where The project runs just like the other except uses the file from the other location, so it can stay updated
Click on the Projects tab to open up your projects. Right click the project you wish to import source code from and choose Properties down at the bottom. You will arrive at the Sources tab automatically.
Under Source Package Folders click the Add Folder button to add the folder containing your source. Once it's been added, you will see it appended in the table. You can then double click the row's text under the Label column to edit the way it appears in the browsing window.
Importing this way means that you don't need a new project just to include files from other places on your computer. You can simply browse for the files you wish to include!

How do I configure Eclipse and Maven to not duplicate folder listings?

Help me please. The problem I'm having is that in Eclipse In the Package Explorer, a Maven project that contains sub Maven projects displays duplicates of the same folders. In addition this causes the 'Ctrl + click' to not work.
So for example if you have a folder hierarchy, and almost each folder is another sub project, such as the following....
1/projectX-dev
2/projectX-dev/web-services
3/projectX-dev/web-services/mapping-data
4/projectX-dev/web-services/mapping-organizations
5/projectX-dev/web-services/metrixs
6/projectX-dev/web-services/metrixs/data-ingest
7/projectX-dev/web-services/metrixs/organization-feeds
Then in my package explorer I would have 7 listed items because each folder has its own .pom file. So for example expanding 5 it would contain the code that is also present in 6 & 7 because it is the parent folder which of course makes sense, but this is most annoying because now there are three locations where I can go to get at information where all I would want is for #1 to be displayed.
In addition to the layout annoyance, in Eclipse it seems that if I open a file under one of the listings over another then the 'Ctrl + click' to navigate to imported class methods no longer is supported. I am growing tired of this and need some clarification on how to just import the Maven projects and have it where the 'Ctrl + click' functions and the display in the Package Explorer would be 1/projectX-dev and that is it. I don't want all the other listings just the main parent folder.
As you can see in the image, the expanded folder netops-nice-jira-dev has items which are all listed at the top level as other projects. i.e. ui-extensions & web-services. The rest-service is a project also and it resides inside of the web-services project. So it is pissing me off how if I open a file from one location it allows for the proper interaction with the file such as Ctrl Click to track methods whereas with opening the file from another location it acts like a plain text file. 1 I don't want all these items to be duplicated in my view I just want the main top level project to be displayed and keep it simple to navigate down the structure rather than trying to find the proper place to open a file from.
Any suggestions on how to NOT display all the projects that are within the project?
The friggin previous people who put together this project created Eclipse projects within Eclipse project folders and everything was added to the Eclipse project view so things are all screwy.
If I open files from one project normal IDE functions will work, if I open the files from within one of the many other projects then the IDE functions don't work where i'm being told the project does not exist on the build path.
How frustrating!

Can't drag folder from one project to another in xcode4

I am trying to use facebook connect and you sare supposed to be able to drag and drop folders but it doesn't work in XCode 4! any ideas?
Update 1/8/2017: This is still true in Xcode 8.2.1
Previously:
drag folder from project A to project B.
Now:
1. in project A, right click - show in finder
2. finder - go up a level
3. drag the folder into project B
4. delete unnecessary files inside the newly added folder
Good job, Apple.
PS: And it doesn't work for groups, as #zeeple mentioned in comments.
Dragging resources between projects in XCode is generally a bad idea in my opinion, even if it is supported. When you drag and drop something in XCode, it doesn't actually create a new copy of that thing, it just adds a new reference to its old location.
This can be very bad, because now changing the resource in one project will make the same changes appear in the other. The vast majority of the time this is not what you want. SCM further complicates things, because if you add a resource to Project B by dragging from Project A and then check in the changes and then some other developer checks out just Project B, they will be missing the resources that you "added" to Project B.
So instead of dragging and dropping in XCode, I suggest using the Finder or the command line to explicitly copy your resources into the destination project's source tree. Then in XCode just add the copied files to the project the same way you normally would.