Jump to content

Shared folder / xlink with Unity 3D plugin


Chief

Recommended Posts

Hi,

 

I'm evaluating Plastic SCM with the new Unity 3D plugin.  It's fairly important that I'm able to set up a shared library folder in my project so I'm able to share some assets across a number of different projects.  Looking through the documentation it looks ilke xlinks are the best way to do this.  However, it looks like they're limited to working on the root folder of the workspace only.  Due to Unity's folder structure (ProjectName\Assets\YourFoldersHere) it seems like I can't use xlinks since the folder I need to share would be (ProjectName\Assets\SharedFolder).

 

Is there some workaround I could do, or some other way to approach this?

 

Thanks.

Link to comment
Share on other sites

Hi,

 

You can create a Xlink on an internal folder of your workspace (not necessary on the root folder).  The limitation is that when you are creating a Xlink, it´s linked to a concrete changeset of a repository (you cannot link a only a part of the repository, you link all the content of the repository on this changeset).

 

You could create a repository containing "SharedFolder" content and share this information between the different projects.

 

 

Regards,

Carlos

Link to comment
Share on other sites

  • 1 month later...

I have a few projects setup this way.  A folder in one project is a writeable xlink to a SharedFolder type repository, and a folder in another project is a writable xlink to that same SharedFolder repository:

 

Repository (SharedFolder) -> SharedFolder in Unity Project 1, and SharedFolder in Unity Project 2.

 

This works, and I can make changes in Unity Project 1 to the SharedFolder contents, and check them in, then later go to Unity Project 2 and point it at a newer changeset.  The issue I'm having is if I make changes from Project 1 and check them in, and then make changes in Project 2 and try to check them in.  Since the xlink is pointed at the changeset in /main for SharedFolder, which is now behind the latest, as soon as I try to check them in within Project 2, which is say, on changeset 5, but Project 1 created changeset 6, I get a conflict.  When the window pops up saying I need to merge, there's nothing to merge or resolve to perhaps create a changeset 7.

 

I'm not entirely sure what the steps are to resolve the issue.  I'm assuming I'd want the new change to be a new branch which could then be later merged back into the /main branch.  I thought that this would happen automatically in the background (branch auto-expansion?) but I probably don't have it configured correctly.  Is there something that needs to be turned on for this to occur, or do I need to branch first in the Unity Projects for the auto-expansion to occur on the writable xlinks?

 

To reiterate the steps I am doing

Make change in Unity Project 1 in SharedFolder xlink.

Make change in Unity Project 2 in SharedFolder xlink.

Merge so that later they are both pointing at the latest version that contains both changes by updating the xlink to the newest changeset.

 

If this isn't clear, I can probably draw a picture/take screenshots of the setup.

Link to comment
Share on other sites

Hi,

 

If you are using SharedFolder in two projects at the same time, I would recommend you to create two branches in Shared Folder repository: "/main/UnityProject1"  and "/main/UnityProject2". 

 

Then if you create a branch on Unity Project 1: "/main/task001"  automatically a branch will be created at SharedFolder: "/main/UnityProject1/task001"

If you create a branch on Unity Project 2: "/main/task001"  automatically a branch will be created at SharedFolder: "/main/UnityProject2/task001"

 

If you need to share the content, you can merge "/main/UnityProject1" and "/main/UnityProject2" branches.

 

You configure Xlink autoexpansion rules when creating Xlinls (or editing them).

When creating the Xlink on Unity Project 1 --> source branch: "/main" , destination branch: "/main/UnityProject1"

When creating the Xlink on Unity Project 2 --> source branch: "/main" , destination branch: "/main/UnityProject2"

 

Regards,

Carlos

Link to comment
Share on other sites

  • 1 month later...

The goal with Xlinks is to point to a directory root. As long as you define your repositories this way you won't have issues.

 

I mean, if you need to link to /code/yourdirectory@repo ... it probably means that /code/yourdirectory should be a different repo... At least that's what we think :-)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...