Resource link path lost in the .blender file #1

Closed
opened 2024-10-25 09:44:16 +02:00 by Sun19 · 9 comments

I lost all resource link paths in my .blender files when adding them to the menu using your addon. When I open my .blender file manually, the resource link paths work fine, but when I open the .blender file using your addon, all the paths no longer function. To describe the error, I can say it's like moving a file from drive C to drive D, which causes the paths to be incorrect.

I lost all resource link paths in my .blender files when adding them to the menu using your addon. When I open my .blender file manually, the resource link paths work fine, but when I open the .blender file using your addon, all the paths no longer function. To describe the error, I can say it's like moving a file from drive C to drive D, which causes the paths to be incorrect.

Hi @Sun19!

Thanks for using the add-on, and for your report!


I think this is due to the fact that, by default, blender use relative paths (// paths, relative to the .blend file location).

So, when you open it as a template, initially there isn't a path at all, and if you save it in a different location than the template, those paths will not match the resources.


As a solution (and i will take care of update my README and wiki to advise about this asap), you can edit your template project, so that all paths became absolute (don't worry; you can do this with one click only, for all resources).

With absolute paths, your resources will work even when the project it not saved yet.

To do so, you can:

  • open your .blend template
  • use the operator File > External Data > Make Paths Absolute
  • Save the project

Once this is done, the template should work without any problems.

Let me know if you are able to solve the problem this way.


P.s. As soon as i have some time, i will check if i can give an option, while adding templates in the list, in order to automate this process (optionally). So users don't have to take care of doing this on their templates.

In case, i will add this feature in the next release!

Hi @Sun19! Thanks for using the add-on, and for your report! --- I think this is due to the fact that, by default, blender use relative paths (`//` paths, relative to the .blend file location). So, when you open it as a template, initially there isn't a path at all, and if you save it in a different location than the template, those paths will not match the resources. --- As a solution (and i will take care of update my README and wiki to advise about this asap), **you can edit your template project, so that all paths became absolute** (don't worry; you can do this with one click only, for all resources). With absolute paths, your resources will work even when the project it not saved yet. To do so, you can: - open your .blend template - use the operator `File > External Data > Make Paths Absolute` - Save the project Once this is done, the template should work without any problems. Let me know if you are able to solve the problem this way. --- P.s. As soon as i have some time, i will check if i can give an option, while adding templates in the list, in order to automate this process (optionally). So users don't have to take care of doing this on their templates. In case, i will add this feature in the next release!
Author

Thank you for your prompt support, I have applied

  • Use the operator File > External Data > Make Paths Absolute and it worked. Thank you very much.
    I hope that in the next update, you will make this process more automatic and easier.
Thank you for your prompt support, I have applied - Use the operator File > External Data > Make Paths Absolute and it worked. Thank you very much. I hope that in the next update, you will make this process more automatic and easier.

I hope that in the next update, you will make this process more automatic and easier.

After some testing and tries, seems like i found a solution to automate this, @Sun19.

It's currently WIP, but should be released very soon in 1.6.0. I just need to test it a bit more, and i want to try it also on Linux and Mac OS to ensure it's working just fine, on all platforms.

You can read something more in the 1.6.0 milestone, since the implementation is almost done.

> I hope that in the next update, you will make this process more automatic and easier. After some testing and tries, seems like i found a solution to automate this, @Sun19. It's currently WIP, but should be released very soon in `1.6.0`. I just need to test it a bit more, and i want to try it also on Linux and Mac OS to ensure it's working just fine, on all platforms. You can read something more in the [1.6.0 milestone](https://projects.blender.org/Francesco-Bellini/custom_templates_addon/milestone/28), since the implementation is almost done.
Author

I hope that in the next update, you will make this process more automatic and easier.

After some testing and tries, seems like i found a solution to automate this, @Sun19.

It's currently WIP, but should be released very soon in 1.6.0. I just need to test it a bit more, and i want to try it also on Linux and Mac OS to ensure it's working just fine, on all platforms.

You can read something more in the 1.6.0 milestone, since the implementation is almost done.

> > I hope that in the next update, you will make this process more automatic and easier. > > After some testing and tries, seems like i found a solution to automate this, @Sun19. > > It's currently WIP, but should be released very soon in `1.6.0`. I just need to test it a bit more, and i want to try it also on Linux and Mac OS to ensure it's working just fine, on all platforms. > > You can read something more in the [1.6.0 milestone](https://projects.blender.org/Francesco-Bellini/custom_templates_addon/milestone/28), since the implementation is almost done.
Sun19 closed this issue 2024-11-06 13:28:31 +01:00
Sun19 reopened this issue 2024-11-06 13:28:53 +01:00
Author

Tôi hy vọng rằng trong bản cập nhật tiếp theo, bạn sẽ làm cho quá trình này trở nên tự động và dễ dàng hơn. > > Sau một số lần thử nghiệm, có vẻ như tôi đã tìm ra giải pháp để tự động hóa việc này, @Sun19. > > Hiện tại nó là WIP, nhưng sẽ sớm được phát hành trong 1.6.0. Tôi chỉ cần kiểm tra nó thêm một chút và tôi cũng muốn thử nó trên Linux và Mac OS để đảm bảo nó hoạt động tốt trên tất cả các nền tảng. > > Bạn có thể đọc thêm nội dung nào đó trong cột mốc 1.6.0, vì quá trình triển khai gần như đã hoàn tất.

I am very happy to receive your message. I am currently using Blender 3.6. I really hope you continue updating to make it compatible with various Blender versions.

> > > Tôi hy vọng rằng trong bản cập nhật tiếp theo, bạn sẽ làm cho quá trình này trở nên tự động và dễ dàng hơn. > > Sau một số lần thử nghiệm, có vẻ như tôi đã tìm ra giải pháp để tự động hóa việc này, @Sun19. > > Hiện tại nó là WIP, nhưng sẽ sớm được phát hành trong `1.6.0`. Tôi chỉ cần kiểm tra nó thêm một chút và tôi cũng muốn thử nó trên Linux và Mac OS để đảm bảo nó hoạt động tốt trên tất cả các nền tảng. > > Bạn có thể đọc thêm nội dung nào đó trong [cột mốc 1.6.0](https://projects.blender.org/Francesco-Bellini/custom_templates_addon/milestone/28), vì quá trình triển khai gần như đã hoàn tất. > > I am very happy to receive your message. I am currently using Blender 3.6. I really hope you continue updating to make it compatible with various Blender versions.

This is based on the operator File > External Data > Make Paths Absolute, and i see the operator is there also on 2.83 (which is my lower supported target), so there shouldn't be any problems.

As usual i will release the legacy edition alongside, and your Blender version will be covered 👍


On a parallel track, i also opened a new proposal on Right Click Select.

Basically, instead of updating the original .blend file, it would be nice to transform the paths on the run, only when opening the template.
This way we wouldn't need to actually update the files.

I hope it will be implemented in some future, so this will be way more fast and less intrusive than my implementation. We'll see...

This is based on the operator `File > External Data > Make Paths Absolute`, and i see the operator is there also on 2.83 (which is my lower supported target), so there shouldn't be any problems. As usual i will release the legacy edition alongside, and your Blender version will be covered 👍 --- On a parallel track, i also opened a new [proposal on Right Click Select](https://blender.community/c/rightclickselect/xVZP/). Basically, instead of updating the original .blend file, it would be nice to transform the paths on the run, only when opening the template. This way we wouldn't need to actually update the files. I hope it will be implemented in some future, so this will be way more fast and less intrusive than my implementation. We'll see...
Francesco Bellini added this to the Version 1.6.0 milestone 2024-11-06 18:02:21 +01:00
Francesco Bellini added this to the Development project 2024-11-07 11:35:13 +01:00
Francesco Bellini added the
enhancement
label 2024-11-07 11:39:05 +01:00
Francesco Bellini added the
bug
label 2024-11-07 11:40:07 +01:00
Author

Điều này dựa trên toán tử Tệp > Dữ liệu ngoài > Tạo đường dẫn tuyệt đối và tôi thấy toán tử cũng có ở đó trên 2.83 (là mục tiêu được hỗ trợ thấp hơn của tôi), vì vậy sẽ không có bất kỳ vấn đề nào. Như thường lệ, tôi sẽ phát hành phiên bản kế thừa cùng với phiên bản Blender của bạn 👍 --- Trong một lộ trình song song, tôi cũng đã mở một [đề xuất mới về Chọn nhấp chuột phải](https://blender.community/c/rightclickselect /xVZP/). Về cơ bản, thay vì cập nhật tệp .blend gốc, sẽ rất tốt nếu chỉ chuyển đổi các đường dẫn khi đang chạy, chỉ khi mở mẫu. Bằng cách này, chúng tôi thực sự không cần phải cập nhật các tập tin. Tôi hy vọng nó sẽ được triển khai trong tương lai, vì vậy việc này sẽ nhanh hơn và ít xâm phạm hơn so với việc triển khai của tôi. Chúng ta sẽ thấy...

In the process of using it, I’ve discovered two additional errors caused by the addon. I’m not sure how to explain them in technical language, but I can describe the issues as follows:

Error 1: This relates to the video rendering section. When I render a video using a file opened through your addon, it often causes frame issues in the rendered video. At first, I didn’t think it was due to your addon, but after a few tests, I realized it was indeed the cause. When I open a file with your addon and render it, a few frames in my video appear in black and white. However, when I open the file manually, this issue does not occur.

Error 2: This occurs in the font selection section for text. When I open a file using your addon, and I add some text and select a font, I can only select a font once. If I try to change the font again, Blender crashes and exits the software.

> Điều này dựa trên toán tử `Tệp > Dữ liệu ngoài > Tạo đường dẫn tuyệt đối` và tôi thấy toán tử cũng có ở đó trên 2.83 (là mục tiêu được hỗ trợ thấp hơn của tôi), vì vậy sẽ không có bất kỳ vấn đề nào. Như thường lệ, tôi sẽ phát hành phiên bản kế thừa cùng với phiên bản Blender của bạn 👍 --- Trong một lộ trình song song, tôi cũng đã mở một [đề xuất mới về Chọn nhấp chuột phải](https://blender.community/c/rightclickselect /xVZP/). Về cơ bản, thay vì cập nhật tệp .blend gốc, sẽ rất tốt nếu chỉ chuyển đổi các đường dẫn khi đang chạy, chỉ khi mở mẫu. Bằng cách này, chúng tôi thực sự không cần phải cập nhật các tập tin. Tôi hy vọng nó sẽ được triển khai trong tương lai, vì vậy việc này sẽ nhanh hơn và ít xâm phạm hơn so với việc triển khai của tôi. Chúng ta sẽ thấy... In the process of using it, I’ve discovered two additional errors caused by the addon. I’m not sure how to explain them in technical language, but I can describe the issues as follows: Error 1: This relates to the video rendering section. When I render a video using a file opened through your addon, it often causes frame issues in the rendered video. At first, I didn’t think it was due to your addon, but after a few tests, I realized it was indeed the cause. When I open a file with your addon and render it, a few frames in my video appear in black and white. However, when I open the file manually, this issue does not occur. Error 2: This occurs in the font selection section for text. When I open a file using your addon, and I add some text and select a font, I can only select a font once. If I try to change the font again, Blender crashes and exits the software.

This sound really strange to me...

My add-on is basically a list of paths and names. When you open a template, you simply call the Blender operator wm.read_homefile with the path of your project. My add-on does nothing more than that, and this is the same operator (not mine) used by Blender for the default templates in the File > New menu.
For this reasons, feels almost impossible to me that my add-on could cause that kind of issues.

I tried both on 4.2 and 3.6:

  • To open a template, add text, change to casual fonts multiple times. Everything works. Fonts are changed.
  • Open a template, and render out 10 animated frames. Everything works exactly like the original file. Results are fine and have colors.

  1. Having problem selecting multiple time the font for a text. This sound more like a blender bug in some unclear context... I have no clue on how Custom Templates could cause that. Also, i didn't experience it on windows.
  2. Having some frames of an animation being black and white? Black and white is a post-processing composition effect or might be selected as color type BW while exporting images or videos. Once again, i have no idea how my add-on could be involved in turning anything black and white. Custom Template is totally inactive while working on/rendering a project.

Are you able to detect some differences between the original .blend and the fresh-opened template?

Unless you can detect some specific changes between the template data and the original .blend template, and provide evidence, or if you have a demo file i could try, which you think might show me the problem on 3.6, i don't have much to work on right now...

As of now, i don't think that Custom Templates could be responsible about this 2 issues.

Let me know 👍

This sound really strange to me... > My add-on is basically a list of paths and names. When you open a template, you simply call the Blender operator `wm.read_homefile` with the path of your project. My add-on does nothing more than that, and this is the same operator (not mine) used by Blender for the default templates in the `File > New` menu. > For this reasons, feels almost impossible to me that my add-on could cause that kind of issues. I tried both on 4.2 and 3.6: - To open a template, add text, change to casual fonts multiple times. Everything works. Fonts are changed. - Open a template, and render out 10 animated frames. Everything works exactly like the original file. Results are fine and have colors. --- 1) Having problem selecting multiple time the font for a text. This sound more like a blender bug in some unclear context... I have no clue on how Custom Templates could cause that. Also, i didn't experience it on windows. 2) Having some frames of an animation being black and white? Black and white is a post-processing composition effect or might be selected as color type `BW` while exporting images or videos. Once again, i have no idea how my add-on could be involved in turning anything black and white. _Custom Template is totally inactive while working on/rendering a project._ Are you able to detect some differences between the original .blend and the fresh-opened template? Unless you can detect some specific changes between the template data and the original .blend template, and provide evidence, or if you have a demo file i could try, which you think might show me the problem on 3.6, i don't have much to work on right now... As of now, i don't think that Custom Templates could be responsible about this 2 issues. Let me know 👍
Francesco Bellini added reference version-1.6.0 2024-11-10 13:18:53 +01:00
Francesco Bellini referenced this issue from a commit 2024-11-10 17:36:46 +01:00

Hi @Sun19!

v1.6.0 has been released, and this include the legacy version!

Check the release, also new features are available!

Hi @Sun19! [v1.6.0](https://projects.blender.org/Francesco-Bellini/custom_templates_addon/releases/tag/v1.6.0) has been released, and this include the legacy version! Check the release, also new features are available!
Francesco Bellini added
issue
not-bug
and removed
bug
labels 2024-11-10 19:18:16 +01:00
Francesco Bellini added
issue
enhancement
and removed
enhancement
labels 2024-11-10 19:24:46 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Francesco-Bellini/custom_templates_addon#1
No description provided.