Questions tagged [path]

Use this tag for question regarding "data paths" and "file paths" in blender.

A link to the blender python API about data paths.

Regarding File Paths and Blender

...

Regarding File Paths and Python

Specifically the topic of how to get a valid file path using Python is worth stating explicitly. Python's os module is capable of joining file paths and extracting directory names or file names:

filename = 'some_file_name.extention'

# known as "POSIX" form (on linux or osx):
directory = '/home/username/Desktop'

# python on windows handles paths in two ways.
directory = r'c:\some\directory'  # the r is important
directory = 'c:/some/directory'  # (alternative)

# this will automatically join directories and a filename to
# produce a full file path
fullpath = os.path.join(directory, filename)

The current file's location is obtained using __file__, and os.path.dirname will return the full directory minus the filename

import os
current_file_path = __file__
current_file_dir = os.path.dirname(__file__)

to access a file in the same directory as this python file you do

other_file_path = os.path.join(current_file_dir, "other_file.ext")
with open(other_file_path) as f:
   ...

if there's a directory on the same path as the main python file you can get that by doing

other_file_path = os.path.join(current_file_dir, "directory", "other_file.ext")
with open(other_file_path) as f:
   ...
483 questions
7
votes
3 answers

How to get a flexible tube to follow a curved path?

Problem: I'm trying to make a flexible tube follow a path I've made with the Path tool (Add > Curve > Path) but even though I've followed a variety of tutorials I can't figure out why my curve just won't allow a tube to follow it. What I need it to…
aussie777
  • 123
  • 1
  • 2
  • 9
6
votes
1 answer

What is the most accurate way to get the data path for a value?

what is the most accurate way to get the full path for a value so I can use it in a single property drivers.
Omar Emara
  • 22,639
  • 5
  • 55
  • 103
5
votes
1 answer

Is there a way to write along a shape?

I´m making this scene by Space Jam and wanted to know how I could make the name of the planet orbiting around it. Thanks!!
3
votes
3 answers

Follow path not align on the path

With the mesh and curve selected . Pressing Ctrl+P to follow path. But the mesh not following the shape of the curve. Some are inside some out side the path. Any suggestion or help how it works. Thanks
atek
  • 10,006
  • 29
  • 91
  • 195
2
votes
1 answer

How to automatically/dynamically repel control points on a path/curve?

I am trying to generate a 3D path which will be then object-bevelled with a circle. The aim is to make some sort of spaguetti. The problem I face is that once I extrude my circle along the path, (as expected) the 3dimensional knot crosses itself. Is…
pedrosaurio
  • 195
  • 6
2
votes
1 answer

Camera constrained to path, not follow it exactly around curves

I have my camera constrained to a curve with Follow Path and it stays with its origin on the path exactly. But when I add a strong curve to the path the camera starts going off the path. It is cutting corners for some reason. Has anyone had…
Officepolicy
  • 163
  • 1
  • 11
2
votes
1 answer

Can I edit the motion path?

Can I change the motion path only by editing the line in the motion path? I want to change the path by editing the line created by the motion path Instead of following the white line I want my bone to follow the red one
Scheff
  • 57
  • 1
  • 7
1
vote
1 answer

Path Tracing Sample in the viewport

When I activate the shading Rendered in the viewport, the number for path tracing sample keeps going with a single number. The number of the last sample is usually listed but it is not the case in the file I imported from a site. I checked the…
1
vote
0 answers

Ball Chain to follow path without distortion?

I am trying to get a ball chain to follow a path without distortion. I learned about "Path Animation" option, but the connecting bar between the balls for the chain still do not follow the path curve properly. I separated the two elements of the…
1
vote
0 answers

Duplication offset ignored in reflections

Good day. I got a weird problem. Again. I created a tunnel scene where I am using a path to create the lamps inside the tunnel. I am using an offset of 4 to reduce the ammount of lamps on the wall. But in the reflections (water puddles) on the…
1
vote
0 answers

How can I make an object hold a position while following a path?

I have my camera following a path. But this path is used by other objects, and these objects need to complete the entire path. But not the camera: I want the camera to stay fixed at one moment. So, my idea was to set the influence of the follow path…
babox
  • 161
  • 1
  • 2
  • 10
1
vote
1 answer

Path Animation Evaluation Time

I want to animate a bone along a curve and I'm mising some information about evaluation time, I 'd like to have the bone move at a range of 0.32m/50frames and I want help with the curve's generator modifier. I would assume that the y-axis in this…
Nikos Makris
  • 165
  • 1
  • 2
  • 10
1
vote
1 answer

Why my object keeps moving when the path is over?

I'm trying to make an image to follow a curve path, but even after the curve has finished the object keeps moving tangent to where the curve had ended. I'm following several tutorials but no one is having this problem by default.
Rafruta
  • 11
  • 1
1
vote
0 answers

How do I make a path animation last longer than 100 frames?

I've got a simple animation that lasts 250 frames and I am trying to create another animation within it but the "Parenting the object to the curve with the Follow Path" option stops after 100 frames - I've seen a similar question being answered…
Beth
  • 11
  • 1
1
vote
1 answer

Change all image textures folder location together

I just downloaded a Kitbash mini-kit blender file and all the references to images are looking in the wrong folder. Is there a way to change all of the images to look in a specific folder? At the moment I'm doing them one by one and it's pretty…
Steve
  • 305
  • 3
  • 14
1
2 3