Code Monkey home page Code Monkey logo

Comments (7)

maximeraafat avatar maximeraafat commented on August 25, 2024

Hi @Erik262, I'm sorry to hear that you are experiencing issues with the code.

I've tried to replicate your issue by running the SOF module with the release v2 version of the addon (I believe you've been using this one, let me know if I'm incorrect), but didn't run into any issues. Could you perhaps let me know the exact steps you've been taking, or at least send me a screenshot of the addon user interface panel with the options you've ticked and chosen?

On a side note, when saying that you gave Blender high rights, do you mean that you gave it the permission to write data on your disk?

from blendernerf.

Erik262 avatar Erik262 commented on August 25, 2024

Hi @maximeraafat, I fixed that problem by creating the folders by hand. Thats it. The only reason why it was not working. Very strange. I used the version in the release section.

from blendernerf.

maximeraafat avatar maximeraafat commented on August 25, 2024

Hi @Erik262 , this is a strange behaviour that shouldn't happen, since the addon takes care of creating all the respective folders. Are you sure that you gave all the necessary permissions to Blender?

A good way to check this would be to go to the Scripting top panel in Blender, and in the Python Console you can enter the following command (be sure to enter any valid existing path for the path variable):

import os
import json
data = {'testdata': 0}
path = '/Users/<yourname>/Downloads/'
foldername = 'testfolder'
folderpath = os.path.join(path, foldername)
os.makedirs(folderpath, exist_ok=True)
filepath = os.path.join(folderpath, 'test.json')
with open(filepath, 'w') as file:
    json.dump(data, file, indent=4)

This code will create a directory called testfolder with a test.json file, saved under path.
Let me know whether this works :)

from blendernerf.

Erik262 avatar Erik262 commented on August 25, 2024

@maximeraafat
I'm getting the same error message. I gave Blender full Access to all folders. Creating/Saving a project works in every folder.

image

Also... I asked a friend to try this addon on his machine (Windows), he is also getting the same error, and I'm on a mac machine.

from blendernerf.

maximeraafat avatar maximeraafat commented on August 25, 2024

Hi @Erik262, ok I see. From what you told me, it seems that creating the .json file itself is not an issue, but creating the directory is. Can you try to run the above code again, but by first creating the testfolder folder manually under the desired location? For the sake of completeness and being sure that this is the issue, can you also run the code below:

import os
import json
data = {'testdata': 0}
path = '/Users/<yourname>/Downloads/'
filepath = os.path.join(path, 'test.json')
with open(filepath, 'w') as file:
    json.dump(data, file, indent=4)

This should directly create a test.json file under path, without creating the intermediary folder. If both of these experiments work without issues, then the issue lies in os.makedirs(folderpath, exist_ok=True), which simply creates the folder if it does not exist yet. To see whether this issue is Blender related, simply open a python environment (for instance by running python3 in a terminal) and run the same code from my previous comment.

from blendernerf.

Erik262 avatar Erik262 commented on August 25, 2024

Hi @maximeraafat so it is definitely an issue with os.makedirs(folderpath, exist_ok=True) If the folder exists, the json file will be created. If not, the same error appears, as mentioned in my first post.
That's very strange if I run the same code in a separate python like you said, it works. But not from the Blender site.

from blendernerf.

maximeraafat avatar maximeraafat commented on August 25, 2024

Hi @Erik262, in this case the issue does not lie with the addon code, but with your computer's permissions with respect to Blender. Perhaps you could reset the permissions in your settings to grant Blender full access to your computer disk. Another suggestion would be to uninstall Blender and reinstall it from scratch, and grant all the access during the installation process.

I am to be honest unsure on the exact steps you should follow to solve this issue. You might want to verify whether you have administrative rights on your computer. Please feel free to share any progress on this topic in this GitHub issue!

from blendernerf.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.