• Welcome to the Community Forums at HiveWire 3D! Please note that the user name you choose for our forum will be displayed to the public. Our store was closed as January 4, 2021. You can find HiveWire 3D and Lisa's Botanicals products, as well as many of our Contributing Artists, at Renderosity. This thread lists where many are now selling their products. Renderosity is generously putting products which were purchased at HiveWire 3D and are now sold at their store into customer accounts by gifting them. This is not an overnight process so please be patient, if you have already emailed them about this. If you have NOT emailed them, please see the 2nd post in this thread for instructions on what you need to do

Panels and Python and CSVs, oh my!

DaremoK3

Enthusiast
Okay, I'm back... I know, I know... I am pretty much a nuisance, but I come bearing gi...(code).

My idea for automating the CSV files has small legs, but it is viable. I created a rudimentary mock-up, but it works. For now, you have to cut/paste the selected images, but I believe this can be automated like Blender's image open without linking to any object data (as not needed here). Also, one has to have the image_list.csv file already in the texture folder. At least it should be faster than hand editing each CSV file every time. I am looking into first writes/overwrites, but will be some time before I can get back to it.

Robyn, please let me know if you would like me to send you the code. You can use it as a starting point, because I know you could flesh this out much better than I can. I made it an addon that adds a panel to your tab.

Here is example of in use. It respects empty places, and leaves your original formatting in place:

WriteImageListCSV.jpg
 

DaremoK3

Enthusiast
Some more feedback regarding my error posting earlier, I still get the Windows error, but the script is working, or at least partially propagating selected textures to their designated channels.

Example below:

FigureShaders_PartialPropigation.jpg

FigureShaders_PartialPropigation1.jpg
 

Robynsveil

Admirable
Wow, I missed all this... no notifications at all! I'm dreadfully sorry, DaremoK... you deserve better than to be ignored!

So, I've got an update out there... it's in a fork or branch or whatever it's called. It writes parm_list.csv and image_list.csv files... so no more hand-editing stuff. It's still in Alpha, so I'm sure there are still a few uncaptured errors, but mostly it's doing as advertised.
 

Robynsveil

Admirable
Also, I promise to keep an eye on this thread. To actually have someone trying to use this is amazing. It's all I've been doing for the past couple of weeks. Even made a rather ordinary video (more to come)... hope to get it working correctly in Linux, Mac and Windows by the end of May.
 

Robynsveil

Admirable
Thank you, Miss B!

As to your code, DaremoK3, I'd be delighted to see it: in the panel, my approach takes way too much real estate. Yours looks a lot more compact, and tidy.
 

Robynsveil

Admirable
Just in case you might be following this, DaremoK3, I'm still cleaning things up. Looking at placing some buttons in a logical sequence in order to prevent "no parm_list.csv file" issues. The steps to take are:
1) find your images folder first - make sure to untick the Relative Path tickbox in that dialogue
2) load your images
3) save your settings, thus creating the parm_list.csv file
4) adjust Principled Shader settings (I'm going to set up better defaults next)
5) Apply the shader, and render happily away
 

DaremoK3

Enthusiast
No worries, Robyn, I know you are a busy woman, and it appears you have been very busy with this lately.

I downloaded the update/fork, and will try to find time to play. I like that you added the auto CSV file creations, and look forward to seeing your solution.

Regarding mine, I will send it to you right away. Just shoot me a PM with an email you would like to use.

Mine is just a simple selection based one, but I was hoping to emulate what the texture selection does by retrieving the texture image (from folder), and only the image name available. I could not get it working without the entire image address, and that would corrupt the CSV write file, so I opted for one import function, and empty strings that you can copy the image name to. This way the write file ends up correct.

I would love if you could figure out how to link only the image name to each string to be written instead of this hacky copy/paste method.
 

Robynsveil

Admirable
I'm a bit embarrassed to say: you'll see some rather pedestrian code in this script. :whistling: I kept get this "cannot iterate object" error when I was trying to do for loops so I've had to spell out object names for now in lists, until I sort that out. Which is a bit meh, but it works.:unsure:

The real point of the script, of course, was first of all to "scratch my own itch" - that's always the first motivator of us open-source fok - I was finding importing and texturing figures all too time-consuming, so this idea was born. It's coming along, but it's far from a proper addon, yet.

Regarding the name-only-without-path thingie: there's a function for that called 'basename'.

So I would create an entry complete with double-quote to write to the csv file like so:

hdc = '"' + bpy.path.basename(fTools.sHeadClr) + '"' # hdc is my shortcut term for head-colour, hdb is for head-bump, etc
hdb = '"' + bpy.path.basename(fTools.sHeadBmp) + '"'

...etc...

and then, add it to an array with:

wrtfile = [] # the array
wrtfile.append('"clrALimb", ' + lbc)
wrtfile.append('"clrLLimb", ' + lbc)

...etc...

and then, write to the .csv file with a UDF that returns "NOPARMS" if unsuccessful and thus generates an error message, or "SAVSUCC" if all went well, which tells the user so:

xChk = imgListSave(wrtfile, curPath)
sErrorMsg = showErrMsg(xChk)


Oh, and why left-limb/right-limb? Non-Daz figures like Antonia split the anatomy up that way, so I had to provide a solution that would work for any figure.

My next big goal - after making sure this also works in Windows... it already runs fine on the Mac - is to get my head around creating node groups programmatically. Then, and only then will I start work on a robust shader designed specifically for skin. :cool: The Principled Shader is okay, but it's better at managing non-organic stuff.

Oh, and perhaps write sub-scripts for hair and clothing and stuff like that. Lots of stuff yet to create! :laugh:
 

Robynsveil

Admirable
Seems to be working, at least, in Linux and on the Mac. Next thing is to check this in Windows and try to create error conditions to make sure they all get trapped.

Thanks for your code, Ken. I'll have a good study of this tonight. If you felt so inclined or had some time to have a go in Windows, I'd thoroughly appreciate it. All and any errors should be trapped and output to that little dialogue box: if not, I'll need to sort out the error and trap for it as well. BTW, there are two zip files, one inside the other, when you download from the github site. The one called make_shaders.zip most likely has a slightly older version (and possibly buggier) than the one contained in parmListRead one. I will try to keep the internal zip (make_shaders.zip) updated, but the newest stuff - the latest bug-fixes - I've just been dropping into the main site.
Just FYI...
 

DaremoK3

Enthusiast
Just a quick check in...

I had a play with Windows (W7 Home Premium), and I have run into a couple of issues. I went back to the beginning, and reinstalled on a clean Blender 2.79b new install, and the issues persist. I am documenting with screen shots, and will add a full report when I can get back to it. I am swamped with work at the moment, so no more time to play.

However, one quick-n-dirty; The new version won't activate/stay activated. It throws an error with addon_utils.py with the register of the OKOperator class. States it is already registered as a subclass.

This prevents the addon checkbox use (and saving active state). The funny thing is, the FigureShaders Tab initializes, and can be used, but will be gone when restarting Blender.

I found a work-around by temporarily disabling the new version (0.5.9), and reactivating the old version (0.5.5) in the addons folder. I activate in the Addons Preferences, save state, close Blender, and reset the addons folder with 0.5.9. When Blender is started again, the new FigureShaders Tab is available for use, and in a saved state.

The good news; I followed your Wiki instructions (which are wonderful) for everything, including your great video tutorial for PP2014 to Blender. I have never used that collect script before, works a treat!

Both, the parm_list.csv, and the image_list.csv created perfectly with your new system. I read the code, and, wow, that was a lot of work. Mine really is just a quick-n-dirty... Your approach is perfect, so I don't think you should change anything.

The bad news; the errors start with Apply Shaders. I believe it is tied to my previous report above with 0.5.5. Somehow, Windows is having an issue with the path retrieval. Errors out with stating can't find textures in the image_list, but error string shows Windows doubling the path string (starting with C:\, and where the texture image should be, the full path string is again, ending with the texture file).

This stops the shader creation dead in it's tracks, and cancels further use.

I hope this helps a little. I have to get back to work. I will play some more when I have some time, and will detail the errors with screen shots for you to troubleshoot.
 

Robynsveil

Admirable
I had a play with Windows (W7 Home Premium), and I have run into a couple of issues. I went back to the beginning, and reinstalled on a clean Blender 2.79b new install, and the issues persist. I am documenting with screen shots, and will add a full report when I can get back to it.
Thank you so much for that, Ken!

However, one quick-n-dirty; The new version won't activate/stay activated. It throws an error with addon_utils.py with the register of the OKOperator class. States it is already registered as a subclass.
Fixed. I've already uploaded the fixed file as a loose file, but haven't included it in the make_shaders.zip file. Will do that this morning. It was a stupid mistake: apparently not all classes need registering.

The good news; I followed your Wiki instructions (which are wonderful) for everything, including your great video tutorial for PP2014 to Blender. I have never used that collect script before, works a treat! Both, the parm_list.csv, and the image_list.csv created perfectly with your new system. I read the code, and, wow, that was a lot of work. Mine really is just a quick-n-dirty... Your approach is perfect, so I don't think you should change anything.
Ah, good to hear! At least that is working right.

The bad news; the errors start with Apply Shaders. I believe it is tied to my previous report above with 0.5.5. Somehow, Windows is having an issue with the path retrieval. Errors out with stating can't find textures in the image_list, but error string shows Windows doubling the path string (starting with C:\, and where the texture image should be, the full path string is again, ending with the texture file).
This stops the shader creation dead in it's tracks, and cancels further use.
I'm going to finish my error situation testing in Linux and Mac this evening, and then devote myself to a complete and thorough session with Windows. I'm pretty sure it's a path-string issue, which it has been in Linux and on the Mac. I'll have to see how the string is generated by Blender for 'relative path' vs 'absolute path' and code accordingly. You can trap for which OS flavour is currently running with:

if os.name == 'posix':
pass
# code to sort Linux and Mac path stuff here
if os.name == 'nt':
pass
# code to sort Windows path stuff here



I hope this helps a little. I have to get back to work. I will play some more when I have some time, and will detail the errors with screen shots for you to troubleshoot.
This helps tremendously, Ken! Thank you so much! Another pair of eyes and hands - particularly knowledgeable ones such as yours - doing things slightly differently to me will bring issues to the surface I would never be able to find.
I know you're a busy fellow, so please let me sort the Windows issues first, as I have not yet even run this in Windows Blender at all before you go through all the effort of screen-capturing bugs and all that. Once I've nutted out the issues to where things seem to run well on my Win7 Pro system, I'll upload the fixes complete with synched make_shaders.zip file and let you know, so you can test then. You'll have a lot less bugs by then, hopefully.
 

Robynsveil

Admirable
Hmmm. Seems the Windows version of Blender is a bit more forgiving of path statements. It appears to work fine whether 'Relative path' is ticked or not. So far, I haven't run into an issue (which is not a good thing, means I can't replicate what you're experiencing unless I have more details. Anyway, I will upload the latest flavour and wait to hear from you, Ken.
 

Robynsveil

Admirable
A bit of reflection about software: I've been away from Windows software in general, and Poser in particular for quite a while (over a couple of years, now), basically recycling saved pz3s to import into Blender to render. Thought I'd have a play in Poser again, just to see if all my "skills" we still there.

You know what? Poser is not easy software. And, it's all what you get used to. For example: something as basic as selecting an object in a scene... I click and click on that object (a shoe), and it keeps selecting the figure behind it (the main figure's toes).

Conforming doesn't work consistently: moving hair to fit a figure, moving clothing to suit a pose... it's so much easier to let a sim manage that!

For those who say Blender is difficult software, I say: have a look at what you're using now... it truly is not that easy to use. I'm truly struggling with Poser Pro 11. Yes, there are easy things to do: applying poses is a breeze. But you would think that "conforming" cloth would follow along when you pose a figure. It does, to a degree, but not consistently. A lot depends on the cloth you've decided to load.

I give this perspective in order to let those who fear ever even trying Blender because it "is so difficult to use" to see another viewpoint. I find Windows difficult to use, now. And Poser a bit of a challenge. It's all what you get used to. Truly.
 

Miss B

Drawing Life 1 Pixel at a Time
CV-BEE
That's why, Robyn, all the years I used DS I selected items in the Scene Tab, and the years I'm now back in Poser, I select anything I need in the Hierarchy Editor. I don't think I've ever tried selecting anything from the scene's workspace.

As far as selecting items in Blender, I select them in the Outliner, so I haven't really come across this, but I happen to agree with you. It is what you get used to. As far as folks finding Blender's UI difficult to get around in, they should've seen the first 2.4x version I played in. Talk about being difficult to get anything done.

I am looking forward to the new 2.8 update, as it's supposed to give folks options as to how they want to see the UI, so for folks who don't like the current default setup, they'll be able to get an easier to use UI.

I've been playing in an educational version of Maya the past couple of years, and it's taken me almost that long to feel comfortable in it, and I'm still learning.
 

Satira Capriccio

Renowned
CV-BEE
Contributing Artist
I select things most often from the document window, and find hovering over the part/object I want to select helps. Within a few seconds, an outline appears. If it's not what you want to select, move the cursor a wee bit until what you want is selected. Next often, I select using the Hierarchy Editor. I don't use this quite as often or body parts or parented props because I tend to collapse items in the list at the Body level so I don't have to scroll through the Hierarchy list.

Finally, I'll use the selection lists at the top of the document window.

I haven't yet retrained myself to right click over the object I want to select and then select the object from the Select menu. That seems like it might be rather more efficient than the other selection methods ... especially when there are many objects in the scene. With a LOT of objects (especially tiny plants) in the scene, selecting from the selection list at the top of the document window tends to be a bit futile.

While I like the convenience of conforming clothing, it tends not to look all that natural with a lot of poses. And yeah. It can be frustrating trying to get conforming hair or clothing to fit properly on some morphed figures.

I agree software tends to be "easy" if you use it frequently. Not a lot of software is all that easy to use when you first start learning it or you rarely use it. Unless it's really basic/simple software such as notepad, which was intended to do one thing. Software like Poser, Photoshop, or ZBrush (just to name a few I use) has so many functions that you really have to use it frequently to become and stay comfortable in it. Which is why I find ZBrush sooo intimidating. I use it so rarely that I have yet to become comfortable in it, and I've lost what comfort level I'd gained.
 

Robynsveil

Admirable
Ah, testing. Sometimes it is good to struggle with one programme, then go back to what you were familiar with, only to realise there are issues there, too. Humility is good for me, excellent antidote for arrogance. :roflmao:

I was finally able to reproduce the "Relative" path issue... now I can fix it!:)
 

Robynsveil

Admirable
Maya! Wow, MissB! I am thoroughly impressed. Not sure I'd venture there, although that is where the key 3D stuff happens. Thank you for the hierarchy editor tip: great idea. :)
 

Robynsveil

Admirable
... Which is why I find ZBrush sooo intimidating. I use it so rarely that I have yet to become comfortable in it, and I've lost what comfort level I'd gained.
I'm with you 100% on ZBrush. Trialed it, and sort-of gave up after a while: just couldn't get the ol' noggin around it. Yet, when I see what folks produce with it, I sort-of wish I'd stuck with it a bit more. Oh well, sculpting in Blender is coming along, so I might just stick with that. I so much more want to do rigging figures... next big project is creating my own figure and rigging that!
 
Top