blenderNetworkpatreonblender-logosdheartuserthtimesbookphotopencilmap-markerchevron-rightbancommentcommentstwitterfacebookrsschainnavicongoogle-plusenvelopelinkedinmail-replycalendar-otumblrredditstumbleuponshare-altbloggerflattrflag

Import Tiff Image to Blender

Import Tiff Image to Blender

Postby Phamhai » January 29th, 2011, 8:19 am

Dear All,

I am trying to import Tiff Image to Blender. I just started using Python for a few days. I just made the code below (from Blender API):

import Blender
from Blender import Image

image = Image.Load("B:/Picture/IMG_1711.jpg")
print "Image from", image.getFilename(),
print "loaded to obj", image.getName()
image.setXRep(4) # set x tiling factor
image.setYRep(2) # set y tiling factor
print "All Images available now:", Image.Get()

This code did not run becase of error "expected int argument in [1,16]"
I do not know what is setting for X and Y tilling factor.
Can anyone tell me how to fix it.
Thank you very much
Phamhai
Newbie
Newbie
 
Posts: 6
Joined: December 2nd, 2010, 8:40 pm

Re: Import Tiff Image to Blender

Postby IrascibleOne » January 29th, 2011, 12:48 pm

I'd probably be able to give a better answer if I knew the specifics about Python, but it looks like you need to make sure that the parameter (at where ever [1,16] is) is an int.

I know in Java you can force something that it considers a double (number with decimal, dunno if that is in Python) into an int by putting "(int)" in front of it. Maybe there is an equivalent in Python that you could use?

That's my best guess, and I only drew that answer from experience with other languages. And I dunno if anyone else on the forum knows Python either...
Image
User avatar
IrascibleOne
Site Admin
Site Admin
 
Posts: 1539
Joined: July 31st, 2008, 7:14 pm

Re: Import Tiff Image to Blender

Postby Nana111 » January 1st, 2014, 8:31 pm

Hi there
I am a newbie here and i have encountered the similar questions with you.I tried to import the tiff image.But it can not work even i have add a tiff image tool.The tiff tool can only load tiff image.I want to know that if there is any image program which supports to do that directly.
Nana111
 
Posts: 1
Joined: January 1st, 2014, 8:19 pm

Re: Import Tiff Image to Blender

Postby IrascibleOne » January 2nd, 2014, 3:25 pm

You are trying to import tiff images into Blender with C#? As far as I know, Blender only uses C/C++ in the source code and then Python for scripting. Or am I totally missing something here?

Also, Welcome to DS! :wave:
Image
User avatar
IrascibleOne
Site Admin
Site Admin
 
Posts: 1539
Joined: July 31st, 2008, 7:14 pm
Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest