"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "release/scripts/modules/bpy_types.py" between
blender-2.93.0.tar.xz and blender-2.93.1.tar.xz

About: Blender is a 3D graphics creation suite allowing modeling, animation, rendering, post-production, realtime interactive 3D and game creation and playback with cross-platform compatibility. LTS (Long Term Support) release.

bpy_types.py  (blender-2.93.0.tar.xz):bpy_types.py  (blender-2.93.1.tar.xz)
skipping to change at line 546 skipping to change at line 546
def as_string(self): def as_string(self):
"""Return the text as a string.""" """Return the text as a string."""
return "\n".join(line.body for line in self.lines) return "\n".join(line.body for line in self.lines)
def from_string(self, string): def from_string(self, string):
"""Replace text with this string.""" """Replace text with this string."""
self.clear() self.clear()
self.write(string) self.write(string)
def as_module(self): def as_module(self):
from os.path import splitext import bpy
from os.path import splitext, join
from types import ModuleType from types import ModuleType
mod = ModuleType(splitext(self.name)[0]) name = self.name
mod = ModuleType(splitext(name)[0])
# This is a fake file-path, set this since some scripts check `__file__`
,
# error messages may include this as well.
# NOTE: the file path may be a blank string if the file hasn't been save
d.
mod.__dict__.update({
"__file__": join(bpy.data.filepath, name),
})
# TODO: We could use Text.compiled (C struct member) # TODO: We could use Text.compiled (C struct member)
# if this is called often it will be much faster. # if this is called often it will be much faster.
exec(self.as_string(), mod.__dict__) exec(self.as_string(), mod.__dict__)
return mod return mod
class Sound(bpy_types.ID): class Sound(bpy_types.ID):
__slots__ = () __slots__ = ()
@property @property
def factory(self): def factory(self):
 End of changes. 2 change blocks. 
2 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)