1. <!DOCTYPE html> <html> <head> <title>Registration Form</title> <style> body { font-family: Arial, sans-serif; margin: 50px; } h1 { text-align: center; } form { max-width: 400px; margin: auto; padding: 20px; border: 1px solid #ccc; border-radius: 10px; } table { width: 100%; margin-bottom: 10px; } td { padding: 8px; } input[type="text"], input[type="password"], textarea { width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 5px; } input[type="submit"] { padding: 10px 20px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } input[type="submit"]:hover { background-color: #45a049; } </style> </head> <body> <h1>Registration Form</h1> <form action="display.php" method="POST"> <table> <tr> <td>Name:</td> <td><input type="text" name="name" required></td> </tr> <tr> <td>Username:</td> <td><input type="text" name="userName" required></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" required></td> </tr> <tr> <td>Mobile Number:</td> <td><input type="text" name="mobilenumber" maxlength="10" required></td> </tr> <tr> <td>Address:</td> <td><textarea name="address" maxlength="200" required></textarea></td> </tr> </table> <div style="text-align: center;"> <input type="submit" name="register" value="Register"> </div> </form> </body> </html> 2. <!DOCTYPE html> <html> <head> <title>Event Search</title> <style> body { font-family: Arial, sans-serif; margin: 50px; } h1 { text-align: center; } form { text-align: center; margin-top: 50px; } input[type="text"] { width: 50%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; } input[type="submit"] { padding: 10px 20px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } input[type="submit"]:hover { background-color: #45a049; } </style> </head> <body> <h1>Event Search</h1> <form action="search.php" method="POST"> <input type="text" name="someText" list="text" placeholder="Search for an event..." required> <datalist id="text"> <option value="Bridal party"> <option value="Engagement parties"> <option value="Caterer"> <option value="Wedding ceremony"> <option value="Wedding reception"> </datalist> <br><br> <input type="submit" name="search" value="Search"> </form> </body> </html>
//contactUs.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact Us - Pink Frag Event Organizer</title> </head> <body> <table border="1" width="100%"> <tr> <td> <a href="index.html">Home</a><br> <a href="events.html">Events</a><br> <a href="aboutUs.html">About us</a><br> <a href="contactUs.html">Contact Us</a><br> </td> <td> <h1>Pink Frag Event Organizer</h1> <h2>Contact Us</h2> <p>14/509A, Sterlin Street, Nungambakkam, Chennai - 600034.</p> </td> </tr> </table> </body> </html> //aboutUs.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>About Us - Pink Frag Event Organizer</title> </head> <body> <table border="1" width="100%"> <tr> <td> <a href="index.html">Home</a><br> <a href="events.html">Events</a><br> <a href="aboutUs.html">About us</a><br> <a href="contactUs.html">Contact Us</a><br> </td> <td> <h1>Pink Frag Event Organizer</h1> <h2>About Us</h2> <p>Pink Frag Event is a reputed organization, which has come into being in 2009, as a Sole Proprietorship Firm, with a sole aim of achieving the trust and support of large customers. We have indulged our all endeavors towards offering trustworthy Wedding Event Management, Promotional Event Management, Birthday Party Management, and many more. To offer these services, we have hired specialized professionals, who are capable of understanding as well as accomplishing the specific customers’ desires.</p> </td> </tr> </table> </body> </html> //events.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Events - Pink Frag Event Organizer</title> </head> <body> <table border="1" width="100%"> <tr> <td> <a href="index.html">Home</a><br> <a href="events.html">Events</a><br> <a href="aboutUs.html">About us</a><br> <a href="contactUs.html">Contact Us</a><br> </td> <td> <h1>Pink Frag Event Organizer</h1> <h2>Events</h2> <h3>Corporate Events</h3> <p>A corporate event can be defined as a gathering that is sponsored by a business for its employees, business partners, clients and/or prospective clients. These events can be for larger audiences such as conventions or smaller events like conferences, meetings, or holiday parties.</p> <h3>Wedding Planning</h3> <p>A wedding planner is a professional who assists with the design, planning and management of a client's wedding. Weddings are significant events in people's lives and as such, couples are often willing to spend considerable amounts of money to ensure that their weddings are well-organized. Wedding planners are often used by couples who work long hours and have little spare time available for sourcing and managing wedding venues and wedding suppliers.</p> <h3>Product Launches</h3> <p>The debut of a product into the market. The product launch signifies the point at which consumers first have access to a new product.</p> </td> </tr> </table> </body> </html> //index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Pink Frag Event Organizer</title> </head> <body> <table border="1" width="100%"> <tr> <td> <a href="index.html">Home</a><br> <a href="events.html">Events</a><br> <a href="aboutUs.html">About us</a><br> <a href="contactUs.html">Contact Us</a><br> </td> <td> <h1>Pink Frag Event Organizer</h1> <h2>Pink Frag Event Organizer</h2> <p>We are indulged in offering a Promotional Event Management. These services are provided by our team of professionals as per the requirement of the client. These services are highly praised for their features like sophisticated technology, effective results and reliability. We offer these services in a definite time frame and at affordable rates.</p> </td> </tr> </table> </body> </html>
$ python manage.py sqlmigrate polls 0001
/* Remove Second Pricing & Add Starting At to Product Page */ .single-product span.woocommerce-Price-amount.amount { margin-right: -100vw !important; background-color: #fff !important; } .single-product p.price::before { content: "STARTING AT"; font-size: 0.79vw; color: black !important; font-weight: 600; padding-right: 0.79vw; } .single-product p.price span.woocommerce-Price-amount:nth-of-type(2) { display: none; }
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), ]
In the more rushing world population, increasing traffic and technological innovation affect most of the things in human life activities, like purchasing their favorite food to clothing. These are the things that have resolved one way to emerge in the booming on-demand industry. The new inventions resolve most of the necessities like food ordering, ride-sharing, grocery purchasing, and a lot more. In that manner, food delivery apps have a well-growing market share in the current year and have a lot of future scope. Doordash is the most important food delivery app in the industry because it is already stronger in some regions like Australia, Canada, Germany, New Zealand, Japan, and the United States That's why entrepreneurs want to adapt their businesses with the same layout and put their brand and add some extra added technological and user-friendly interface to make and achieve it. If these are the things you want to accomplish for your business, then reach out to Appticz, the top-level solution provider, for any kind of on-demand app development business idea. They also provide a premium Doordash clone app that provides most of the entrepreneur's needs.
A interoperabilidade no sistema bancário em Moçambique é uma realidade, tendo a SIMO como ponto central de gestão do sistema integrado de transações. Os bancos passaram a receber um conjunto de dados (em ficheiros de texto) transacionados nos seus terminais como POSs (compras) e ATMs (levantamentos/pagamentos) por meios de cartões. Por forma a garantir o melhor controle e rentabilidade (pelo menos uma transação) dos cartões. Considere a estrutura do ficheiro de transações de clientes (Clientes Ativos - 1 transação dentro de 90 dias, Clientes inativos - Transações acima de 90 dias) recebido abaixo: Estrutura da tabela a considerar: | Data | Transacao_ID | Terminal_ID | Tipo_Terminal | Valor | Cliente | Idade | Tipo_Cartao | Provincia | Distrito | |---|---|---|---|---|---|---|---|---|---| 1. Crie um modelo normalizado e os devidos relacionamentos de acordo com a tabela. 2. Com base nas tabelas normalizadas escreva uma query que indique todos os clientes inactivos da província de Gaza, com mais levantamentos. 3. Tendo em consideração que para o banco uma “boa” rentabilidade é ter transações acima de MZN 1000. Indique a província do cliente menos rentável e com mais transações. 4. Ainda sobre a “boa rentabilidade”, indique a província com maior número de clientes activos e menos rentáveis. 5. Continuando sobre a “boa rentabilidade”, indique o cliente ativo mais velho, que realizou mais pagamentos no dia da independência. -- 1. Criação do modelo normalizado CREATE TABLE Cliente ( ClienteID INT PRIMARY KEY, Nome VARCHAR(100), Idade INT ); CREATE TABLE Cartao ( CartaoID INT PRIMARY KEY, ClienteID INT, Tipo_Cartao VARCHAR(50), FOREIGN KEY (ClienteID) REFERENCES Cliente(ClienteID) ); CREATE TABLE Localizacao ( LocalizacaoID INT PRIMARY KEY, Provincia VARCHAR(50), Distrito VARCHAR(50) ); CREATE TABLE Terminal ( TerminalID VARCHAR(50) PRIMARY KEY, Tipo_Terminal VARCHAR(20), LocalizacaoID INT, FOREIGN KEY (LocalizacaoID) REFERENCES Localizacao(LocalizacaoID) ); CREATE TABLE Transacao ( TransacaoID VARCHAR(50) PRIMARY KEY, Data DATE, Valor DECIMAL(10,2), CartaoID INT, TerminalID VARCHAR(50), FOREIGN KEY (CartaoID) REFERENCES Cartao(CartaoID), FOREIGN KEY (TerminalID) REFERENCES Terminal(TerminalID) ); -- Inserção de dados de exemplo (opcional, para teste) -- Inserção de dados de exemplo -- Clientes INSERT INTO Cliente (ClienteID, Nome, Idade) VALUES (1, 'João Silva', 35), (2, 'Maria Santos', 28), (3, 'Pedro Nunes', 45), (4, 'Ana Oliveira', 50), (5, 'Edson Famanda', 29), (6, 'Luísa Costa', 42), (7, 'António Mendes', 55), (8, 'Sofia Rodrigues', 30), (9, 'Miguel Almeida', 38), (10, 'Beatriz Sousa', 47); -- Cartões INSERT INTO Cartao (CartaoID, ClienteID, Tipo_Cartao) VALUES (101, 1, 'Débito'), (102, 2, 'Crédito'), (103, 3, 'Débito'), (104, 4, 'Crédito'), (105, 5, 'Débito'), (106, 6, 'Crédito'), (107, 7, 'Débito'), (108, 8, 'Crédito'), (109, 9, 'Débito'), (110, 10, 'Crédito'); -- Localizações INSERT INTO Localizacao (LocalizacaoID, Provincia, Distrito) VALUES (201, 'Gaza', 'Xai-Xai'), (202, 'Maputo', 'Matola'), (203, 'Sofala', 'Beira'), (204, 'Nampula', 'Nampula'), (205, 'Gaza', 'Chibuto'), (206, 'Inhambane', 'Inhambane'), (207, 'Tete', 'Tete'), (208, 'Zambézia', 'Quelimane'), (209, 'Cabo Delgado', 'Pemba'), (210, 'Niassa', 'Lichinga'); -- Terminais INSERT INTO Terminal (TerminalID, Tipo_Terminal, LocalizacaoID) VALUES ('T001', 'ATM', 201), ('T002', 'POS', 202), ('T003', 'ATM', 203), ('T004', 'POS', 204), ('T005', 'ATM', 205), ('T006', 'POS', 206), ('T007', 'ATM', 207), ('T008', 'POS', 208), ('T009', 'ATM', 209), ('T010', 'POS', 210); -- Transações (50 transações) INSERT INTO Transacao (TransacaoID, Data, Valor, CartaoID, TerminalID) VALUES ('TR001', '2024-06-25', 500.00, 101, 'T001'), ('TR002', '2024-06-25', 1200.00, 102, 'T002'), ('TR003', '2024-05-15', 800.00, 103, 'T003'), ('TR004', '2024-06-25', 1500.00, 104, 'T004'), ('TR005', '2024-03-01', 300.00, 105, 'T005'), ('TR006', '2024-06-25', 2000.00, 106, 'T006'), ('TR007', '2024-06-01', 100.00, 107, 'T007'), ('TR008', '2024-06-10', 950.00, 108, 'T008'), ('TR009', '2024-06-15', 1100.00, 109, 'T009'), ('TR010', '2024-06-20', 750.00, 110, 'T010'), ('TR011', '2024-06-25', 600.00, 101, 'T001'), ('TR012', '2024-05-30', 1800.00, 102, 'T002'), ('TR013', '2024-04-22', 400.00, 103, 'T003'), ('TR014', '2024-06-25', 2500.00, 104, 'T004'), ('TR015', '2024-02-15', 200.00, 105, 'T005'), ('TR016', '2024-06-25', 3000.00, 106, 'T006'), ('TR017', '2024-05-18', 150.00, 107, 'T007'), ('TR018', '2024-06-05', 1050.00, 108, 'T008'), ('TR019', '2024-06-12', 900.00, 109, 'T009'), ('TR020', '2024-06-19', 1250.00, 110, 'T010'), ('TR021', '2024-06-25', 700.00, 101, 'T001'), ('TR022', '2024-06-02', 1600.00, 102, 'T002'), ('TR023', '2024-05-10', 550.00, 103, 'T003'), ('TR024', '2024-06-25', 2200.00, 104, 'T004'), ('TR025', '2024-01-20', 350.00, 105, 'T005'), ('TR026', '2024-06-25', 2800.00, 106, 'T006'), ('TR027', '2024-04-30', 180.00, 107, 'T007'), ('TR028', '2024-06-08', 1150.00, 108, 'T008'), ('TR029', '2024-06-14', 980.00, 109, 'T009'), ('TR030', '2024-06-22', 1450.00, 110, 'T010'), ('TR031', '2024-06-25', 850.00, 101, 'T001'), ('TR032', '2024-05-28', 2100.00, 102, 'T002'), ('TR033', '2024-04-18', 480.00, 103, 'T003'), ('TR034', '2024-06-25', 3200.00, 104, 'T004'), ('TR035', '2024-02-10', 280.00, 105, 'T005'), ('TR036', '2024-06-25', 3500.00, 106, 'T006'), ('TR037', '2024-05-22', 220.00, 107, 'T007'), ('TR038', '2024-06-03', 1350.00, 108, 'T008'), ('TR039', '2024-06-11', 1020.00, 109, 'T009'), ('TR040', '2024-06-18', 1650.00, 110, 'T010'), ('TR041', '2024-06-25', 920.00, 101, 'T001'), ('TR042', '2024-06-01', 2400.00, 102, 'T002'), ('TR043', '2024-05-08', 630.00, 103, 'T003'), ('TR044', '2024-06-25', 2900.00, 104, 'T004'), ('TR045', '2024-01-15', 380.00, 105, 'T005'), ('TR046', '2024-06-25', 3800.00, 106, 'T006'), ('TR047', '2024-04-25', 250.00, 107, 'T007'), ('TR048', '2024-06-07', 1550.00, 108, 'T008'), ('TR049', '2024-06-13', 1080.00, 109, 'T009'), ('TR050', '2024-06-21', 1850.00, 110, 'T010'); -- 2. Query para clientes inativos da província de Gaza, com mais levantamentos SELECT c.ClienteID, c.Nome, COUNT(*) as NumLevantamentos FROM Cliente c JOIN Cartao ca ON c.ClienteID = ca.ClienteID JOIN Transacao t ON ca.CartaoID = t.CartaoID JOIN Terminal te ON t.TerminalID = te.TerminalID JOIN Localizacao l ON te.LocalizacaoID = l.LocalizacaoID WHERE l.Provincia = 'Gaza' AND te.Tipo_Terminal = 'ATM' AND t.Data < DATE_SUB(CURDATE(), INTERVAL 90 DAY) GROUP BY c.ClienteID, c.Nome ORDER BY NumLevantamentos DESC; -- 3. Província do cliente menos rentável e com mais transações SELECT l.Provincia FROM Cliente c JOIN Cartao ca ON c.ClienteID = ca.ClienteID JOIN Transacao t ON ca.CartaoID = t.CartaoID JOIN Terminal te ON t.TerminalID = te.TerminalID JOIN Localizacao l ON te.LocalizacaoID = l.LocalizacaoID GROUP BY l.Provincia ORDER BY SUM(CASE WHEN t.Valor > 1000 THEN 1 ELSE 0 END) ASC, COUNT(*) DESC LIMIT 1; -- 4. Província com maior número de clientes ativos e menos rentáveis SELECT l.Provincia FROM Cliente c JOIN Cartao ca ON c.ClienteID = ca.ClienteID JOIN Transacao t ON ca.CartaoID = t.CartaoID JOIN Terminal te ON t.TerminalID = te.TerminalID JOIN Localizacao l ON te.LocalizacaoID = l.LocalizacaoID WHERE t.Data >= DATE_SUB(CURDATE(), INTERVAL 90 DAY) GROUP BY l.Provincia ORDER BY COUNT(DISTINCT c.ClienteID) DESC, SUM(CASE WHEN t.Valor <= 1000 THEN 1 ELSE 0 END) DESC LIMIT 1; -- 5. Cliente ativo mais velho, com mais pagamentos no dia da independência SELECT c.ClienteID, c.Nome, c.Idade, COUNT(*) as NumPagamentos FROM Cliente c JOIN Cartao ca ON c.ClienteID = ca.ClienteID JOIN Transacao t ON ca.CartaoID = t.CartaoID JOIN Terminal te ON t.TerminalID = te.TerminalID WHERE te.Tipo_Terminal = 'POS' AND DAY(t.Data) = 25 AND MONTH(t.Data) = 6 AND t.Data >= DATE_SUB(CURDATE(), INTERVAL 90 DAY) GROUP BY c.ClienteID, c.Nome, c.Idade ORDER BY c.Idade DESC, NumPagamentos DESC LIMIT 1;
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Event Schedule List</title> </head> <body> <h1>Event Schedule List</h1> <div id="CommonEvents"> <h2>Supported Events</h2> <ul type="circle"> <li>Concerts</li> <li>Conferences</li> <li>Films</li> <li>Panel Debates</li> <li>Performances</li> <li>Seminars</li> <li>Talks & Discussions</li> <li>Workshops</li> </ul> </div> <div id="CorporateEvents"> <h2>Corporate Events</h2> <ul type="square"> <li>Team Building Events</li> <li>Trade Shows</li> <li>Business Dinners</li> <li>Networking Events</li> <li>Opening Ceremonies</li> <li>Product Launches2018</li> <li>Theme Parties</li> <li>Shareholder Meetings</li> </ul> </div> </body> </html>
function create_faqs() { $labels = array( 'name' => _x('FAQs', 'Post Type General Name', 'textdomain'), 'singular_name' => _x('FAQ', 'Post Type Singular Name', 'textdomain'), 'menu_name' => _x('FAQs', 'Admin Menu text', 'textdomain'), 'name_admin_bar' => _x('FAQs', 'Add New on Toolbar', 'textdomain'), 'archives' => __('FAQs Archives', 'textdomain'), 'attributes' => __('FAQs Attributes', 'textdomain'), 'parent_item_colon' => __('Parent FAQs:', 'textdomain'), 'all_items' => __('All FAQs', 'textdomain'), 'add_new_item' => __('Add New FAQs', 'textdomain'), 'add_new' => __('Add New', 'textdomain'), 'new_item' => __('New FAQs', 'textdomain'), 'edit_item' => __('Edit FAQs', 'textdomain'), 'update_item' => __('Update FAQs', 'textdomain'), 'view_item' => __('View FAQs', 'textdomain'), 'view_items' => __('View FAQs', 'textdomain'), 'search_items' => __('Search FAQs', 'textdomain'), 'not_found' => __('Not found', 'textdomain'), 'not_found_in_trash' => __('Not found in Trash', 'textdomain'), 'featured_image' => __('Featured Image', 'textdomain'), 'set_featured_image' => __('Set featured image', 'textdomain'), 'remove_featured_image' => __('Remove featured image', 'textdomain'), 'use_featured_image' => __('Use as featured image', 'textdomain'), 'insert_into_item' => __('Insert into FAQs', 'textdomain'), 'uploaded_to_this_item' => __('Uploaded to this FAQs', 'textdomain'), 'items_list' => __('FAQs list', 'textdomain'), 'items_list_navigation' => __('FAQs list navigation', 'textdomain'), 'filter_items_list' => __('Filter FAQs list', 'textdomain'), ); $rewrite = array( 'slug' => 'faqS', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __('FAQs', 'textdomain'), 'description' => __('', 'textdomain'), 'labels' => $labels, 'menu_icon' => 'dashicons-format-status', 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'post-formats', 'custom-fields'), 'taxonomies' => array(), 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'hierarchical' => true, 'exclude_from_search' => true, 'show_in_rest' => true, 'publicly_queryable' => true, 'capability_type' => 'post', 'rewrite' => $rewrite, ); register_post_type('faqs', $args); register_taxonomy('faqs_category', 'faqs', array('hierarchical' => true, 'label' => 'Category', 'query_var' => true, 'rewrite' => array('slug' => 'faqs-category'))); } add_action('init', 'create_faqs', 0); function faq_loops($atts) { // Default attributes. $default = array( 'category' => '', ); // Merge user-defined attributes with defaults. $button_attrs = shortcode_atts($default, $atts); // Argument to fetch FAQs based on category. $arg = array( 'post_type' => 'faqs', 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'faqs_category', 'field' => 'slug', 'terms' => $button_attrs['category'], // Use category attribute passed in shortcode // 'operator' => 'IN', ), ), ); // print_r($arg); // Display FAQs $faqsPost = new WP_Query($arg); ?> <div id="mainfaqs" class="faq-list"> <?php if ($faqsPost->have_posts()) : ?> <?php while ($faqsPost->have_posts()) : $faqsPost->the_post(); ?> <div class="faq"> <div class="faq__question"> <div class="faq__ttl "><?php the_title(); ?></div> <div class="faq__close"></div> </div> <div class="faq__answer" style="display: none; transition: max-height 0.3s ease;"> <div class="faq__txt" style=" "> <?php the_content(); ?> </div> </div> </div> <?php $x++; ?> <?php endwhile; ?> <?php else : ?> <p>No FAQs found in this category.</p> <?php endif; ?> </div> <?php wp_reset_postdata(); } add_shortcode('mainfaqs', 'faq_loops'); // pass shortcode like this: [mainfaqs category="mainhome"] //jquery jQuery(function () { jQuery(".faq__question").on('click', function () { let box = jQuery(this).closest(".faq"); let openBox = jQuery(".faq_active"); // Check if the clicked FAQ is not the currently open one if (box.hasClass('faq_active')) { // If it's the same one, just toggle it box.find('.faq__answer').slideUp(300); box.removeClass('faq_active'); } else { // Otherwise, close the currently open FAQ and open the new one openBox.find('.faq__answer').slideUp(300); openBox.removeClass('faq_active'); box.find('.faq__answer').slideDown(300); box.addClass('faq_active'); } }); });
Most entrepreneurs want to start their business in the crypto field, but many don't have a proper idea of how to kickstart their business. Therefore, most of them choose their business with cryptocurrency wallet development services. Let's see the way to start their business in the crypto industry. 1. Choose your Audience Fixing your crypto wallet business is beneficial for your users that avail unique benefits and provide value from your business. Define your audience who will benefit from and use your crypto wallet services. 2. Legal and Regulatory Compliance Comply with and follow the legal regulations that are related to your crypto wallet business 3. Select a Suitable Wallet Solution In this stage, you have 3 ways to lead your crypto wallet business in an open-source, white-label solution and develop from scratch. This choice may differ from every entrepreneur to others because it depends upon the time and budget. 4. Incorporate Essential features Your platform should support multiple cryptocurrencies and be combined with a lot of security features such as two-factor authentication, cold storage, and encryption. Create a platform whose user interface is more clear and easy to access for all users. Ensure you should incorporate a prominent payment gateway for receiving your payments, deposits, or withdrawals in fiat currencies. 5. Additional Features Permit your platform users to buy, sell, and trade cryptocurrencies within the wallet. Integrate Defi features such as staking and lending to avail your users to expand your revenue stream. Further, it enables buying and selling NFTs with your crypto wallet. 6. Security and Testing Conduct rigorous testing and identify your platform bugs and any tech vulnerabilities. Take necessary security periodic security audits to find your platform data security. 7. Marketing and Promotion Create your marketing plan to reach your audience by advertising in targeted paid ads. Leverage famous social networks like Twitter, Telegram, and Reddit to engage your audience at all times. In the tech world, influencer marketing is a remarkable way to collaborate with other crypto businesses or influencers to promote your business in the internet world. If you're looking to create your crypto wallet for your business, then Appticz is the best crypto wallet development solution provider in the competitive crypto industry.
<?php /** * Checkout billing information form * * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-billing.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 3.6.0 * @global WC_Checkout $checkout */ defined('ABSPATH') || exit; $fields = $checkout->get_checkout_fields('billing'); ?> <?php if (!is_user_logged_in() && $checkout->is_registration_enabled()) : ?> <div class="woocommerce-billing-fields woocommerce-billing-fields-top"> <h3><?php esc_html_e('Login', 'woocommerce'); ?></h3> <p>Log in to place your order</p> <div class="woocommerce-billing-fields__field-wrapper"> <?php foreach ($fields as $key => $field) { if ($key === 'billing_email') { woocommerce_form_field($key, $field, $checkout->get_value($key)); } } ?> <p class="form-row form-row-wide" id="billing_password_field" data-priority="110"> <span class="woocommerce-input-wrapper"> <input type="password" class="input-text" name="billing_password" id="billing_password" placeholder="Password"> </span> </p> <div class="flogin-btn"> <button type="button"><?php _e('Login and place order', 'wp'); ?></button> </div> <div class="flogin-footer"> <div>Not yet a member?</div> <div>create an account</div> <div>Create an account and place your order</div> </div> </div> </div> <?php else : ?> <div class="woocommerce-billing-fields"> <h3><?php esc_html_e('Account', 'woocommerce'); ?></h3> <div class="woocommerce-billing-fields__field-wrapper"> <?php foreach ($fields as $key => $field) { if ($key === 'billing_email') { woocommerce_form_field($key, $field, $checkout->get_value($key)); } } ?> </div> </div> <?php endif; ?> <div class="woocommerce-billing-fields"> <?php if (wc_ship_to_billing_address_only() && WC()->cart->needs_shipping()) : ?> <h3><?php esc_html_e('Billing & Shipping', 'woocommerce'); ?></h3> <?php else : ?> <h3><?php esc_html_e('Billing Info', 'woocommerce'); ?></h3> <?php endif; ?> <?php do_action('woocommerce_before_checkout_billing_form', $checkout); ?> <div class="woocommerce-billing-fields__field-wrapper"> <?php foreach ($fields as $key => $field) { if ($key !== 'billing_email') { woocommerce_form_field($key, $field, $checkout->get_value($key)); } } ?> <?php woocommerce_form_field('billing_notes', array( 'type' => 'textarea', 'class' => array('form-row-wide'), 'label' => false, 'placeholder' => __('Order notes(optional)', 'woocommerce'), 'required' => false, ), $checkout->get_value('billing_notes')); ?> <div class="form-row shipping-address-method-field"> <input type="radio" name="shipping-address-method[]" value="billing_address" id="method-billing_address" checked> <label for="method-billing_address">Ship to this address</label> </div> </div> <?php do_action('woocommerce_after_checkout_billing_form', $checkout); ?> </div> <?php if (!is_user_logged_in() && $checkout->is_registration_enabled()) : ?> <div class="woocommerce-account-fields"> <?php if (!$checkout->is_registration_required()) : ?> <p class="form-row form-row-wide create-account"> <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> <input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="createaccount" <?php checked((true === $checkout->get_value('createaccount') || (true === apply_filters('woocommerce_create_account_default_checked', false))), true); ?> type="checkbox" name="createaccount" value="1" /> <span><?php esc_html_e('Create an account?', 'woocommerce'); ?></span> </label> </p> <?php endif; ?> <?php do_action('woocommerce_before_checkout_registration_form', $checkout); ?> <?php if ($checkout->get_checkout_fields('account')) : ?> <div class="create-account"> <?php foreach ($checkout->get_checkout_fields('account') as $key => $field) : ?> <?php woocommerce_form_field($key, $field, $checkout->get_value($key)); ?> <?php endforeach; ?> <div class="clear"></div> </div> <?php endif; ?> <?php do_action('woocommerce_after_checkout_registration_form', $checkout); ?> </div> <?php endif; ?>
function custom_modify_query( $query ) { if ( ! is_admin() && $query->is_main_query() ) { if ( is_shop() ) { $query->set( 'posts_per_page', 12 ); } } } add_action( 'pre_get_posts', 'custom_modify_query' ); // Check product has sale function is_product_on_sale($product_id) { $product = wc_get_product($product_id); if ($product->is_on_sale()) { return true; } if ($product->is_type('variable')) { $variants = $product->get_children(); foreach ($variants as $variant_id) { $variant = wc_get_product($variant_id); if ($variant->is_on_sale()) { return true; } } } return false; } // Check product has sale function count_sale_products() { $transient_key = 'count_sale_products'; $cached_count = get_transient($transient_key); if ($cached_count !== false) { return $cached_count; } else { $products = wc_get_products(['return' => 'ids', 'status' => 'publish', 'limit' => -1, 'type' => array('simple', 'variable', 'bundle', 'external', 'grouped')]); $saleProduct = []; foreach ($products as $product_id) { if (is_product_on_sale($product_id)) { $saleProduct[] = $product_id; } } $sale_count = count($saleProduct); set_transient($transient_key, $sale_count, 5 * MINUTE_IN_SECONDS); return $sale_count; } } function get_discounted_variants_of_product($product_id) { $product = wc_get_product($product_id); if ($product->is_type('variable')) { $variants = $product->get_children(); $discounted_variants = array(); foreach ($variants as $variant_id) { $variant = wc_get_product($variant_id); //print_r($variant->status); die; if( $variant->status == 'publish') $discounted_variants[] = array( 'id' => $variant->get_id(), 'sale_price' => $variant->get_sale_price(), 'regular_price' => $variant->get_regular_price(), 'name' => $variant->get_name(), 'sku' => $variant->get_sku(), ); } return $discounted_variants; } return false; } function getStockStatusCountProduct($instock = true){ $stock_status = 'instock'; if(!$instock) $stock_status = 'outofstock'; $args = array( 'stock_status' => $stock_status, 'limit' => -1, 'status' => 'publish', 'type' => array('simple', 'variable'), ); $products = wc_get_products( $args ); return count($products); } function customRatingScoreHTML($productID){ $product = wc_get_product($productID); $average = $product->get_average_rating(); $rating_whole = floor($average); $rating_fraction = $average - $rating_whole; $flug = 0; for($i = 1; $i <= 5; $i++){ if( $i <= $rating_whole ){ echo '<i class="fas fa-star"></i>'; } else{ if( $rating_fraction > 0 && $flug == 0 ){ echo '<i class="fas fa-star-half-alt"></i>'; $flug = 1; } else{ echo '<i class="far fa-star empty"></i>'; } } } } function customShopGridShortcode($atts=[]){ ob_start(); $availability = isset($_GET['availability'])?$_GET['availability']:'instock'; $category = isset($_GET['category'])?$_GET['category']:''; $tag = isset($_GET['tg'])?$_GET['tg']:''; //$on_sale = isset($_GET['on_sale'])?$_GET['on_sale']:''; $orderBy = isset($_GET['orderby'])?$_GET['orderby']:''; $keyword = isset($_GET['s'])?$_GET['s']:''; $paged = max(get_query_var('paged'),1); $args = [ 'post_type' => ['product'], 'paged' => $paged, 'posts_per_page' => 12, ]; if(!empty($category) && $category!= 'all') $args['tax_query'] = [ 'relation' => 'AND', [ 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => array( $category ), ], ]; if(!empty($tag)){ if(array_key_exists ('tax_query',$args)){ $args['tax_query'][] = [ 'taxonomy' => 'product_tag', 'field' => 'slug', 'terms' => array( $tag ), ]; } else{ $args['tax_query'] = [ 'relation' => 'AND', [ 'taxonomy' => 'product_tag', 'field' => 'slug', 'terms' => array( $tag ), ], ]; } } // if(!empty($on_sale) && $on_sale == 1){ // } if(!empty($availability)){ if($availability == 'sale'){ $products = wc_get_products( ['return' => 'ids','status' => 'publish','limit' => -1,'type' => array('simple', 'variable', 'bundle','external','grouped')] ); $saleProduct = []; foreach($products as $vv){ if(is_product_on_sale($vv)){ $saleProduct[] = $vv; } } if(!empty($saleProduct)) $args['post__in'] = $saleProduct; else $args['post__in'] = [0]; // if(array_key_exists('tax_query',$args)){ // $args['tax_query'][] = [ // 'key' => '_sale_price', // 'value' => '', // 'compare' => '!=' // ]; // } // else{ // $args['tax_query'] = [ // 'relation' => 'AND', // [ // 'key' => '_sale_price', // 'value' => '', // 'compare' => '!=' // ], // ]; // } } else{ $products = wc_get_products( ['stock_status' => $availability,'return' => 'ids','status' => 'publish','limit' => -1,'type' => array('simple', 'variable', 'bundle','external','grouped')] ); if(!empty($products)) $args['post__in'] = $products; else $args['post__in'] = [0]; } //print_r($products); } if(!empty($orderBy)){ if($orderBy == 'popularity'){ $args['meta_key'] = 'total_sales'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'DESC'; } if($orderBy == 'rating'){ $args['meta_key'] = '_wc_average_rating'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'DESC'; } if($orderBy == 'date'){ $args['orderby'] = 'date'; $args['order'] = 'DESC'; } if($orderBy == 'price'){ $args['meta_key'] = '_price'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'ASC'; } if($orderBy == 'price-desc'){ $args['meta_key'] = '_price'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'DESC'; } } if(!empty($keyword)){ $args['s'] = $keyword; } if(isset($_GET['dev'])) print_r($args); $the_query = new WP_Query( $args ); ?> <div class="customShopGrid-wrap"> <form id="frmFilterProduct" method="GET" action=""> <div class="frmFilterProduct-ajax"> <?php $sort_arr = [ 'menu_order' => __('Default Sorting'), 'popularity' => __('Best Selling'), 'rating' => __('Average Rating'), 'date' => __('Latest Product'), 'price' => __('Price Low To High'), 'price-desc' => __('Price High To Low'), ]; ?> <div class="customShopGrid-order-wrap"> <div class="customShopGrid-order orderbyPC"> <span>Sort By:</span> <select id="orderby" class="slOrder" name="orderby"> <?php foreach($sort_arr as $key => $value):?> <option value="<?php echo $key; ?>" <?php if($orderBy == $key) echo 'selected'?>><?php echo $value; ?></option> <?php endforeach; ?> </select> </div> </div> <div class="customShopGrid"> <div class="customShopGrid-left"> <div class="customShopGrid-filter"> <div class="customShopGrid-filter-top customShopGrid-filter-space"> <h2 class="customShopGrid-filter-heading">Filter Products</h2> <img src="https://vancitylabs.co/wp-content/uploads/2024/04/setting-ic.svg" /> </div> <div class="customShopGrid-filter-list"> <div class="customShopGrid-filter-group"> <div class="customShopGrid-filter-group-head customShopGrid-filter-space"> <h3 class="customShopGrid-filter-heading">Availability</h3> </div> <div class="customShopGrid-filter-group-content"> <ul> <li> <label class="custom-checkbox"> <input id="Availability-instock" class="filter-checkbox" type="checkbox" name="availability" value="instock" <?php if($availability == 'instock') echo 'checked' ?> /> <span style='font-size: 18px'>In Stock (<?php echo getStockStatusCountProduct()?>)</span> </label> </li> <li> <label class="custom-checkbox"> <input id="Availability-outstock" class="filter-checkbox" type="checkbox" name="availability" value="outofstock" <?php if($availability == 'outofstock') echo 'checked' ?> /> <span style='font-size: 18px'>Out of Stock (<?php echo getStockStatusCountProduct(false)?>)</span> </label> </li> <li> <label class="custom-checkbox"> <input id="Availability-outstock" class="filter-checkbox" type="checkbox" name="availability" value="sale" <?php if($availability == 'sale') echo 'checked' ?> /> <span style='font-size: 18px'>On Sale (<?php echo count_sale_products();?>)</span> </label> </li> </ul> </div> </div> <!--end group--> <?php $cats = get_terms([ 'taxonomy' => 'product_cat', 'hide_empty' => true, 'parent' => 0, ]); if(!empty($cats)): ?> <div class="customShopGrid-filter-group"> <div class="customShopGrid-filter-group-head customShopGrid-filter-space"> <h3 class="customShopGrid-filter-heading">Categories</h3> </div> <div class="customShopGrid-filter-group-content"> <ul> <li> <label class="custom-checkbox"> <input class="filter-checkbox" type="checkbox" name="category" value="all" <?php if($category == 'all') echo 'checked' ?> /> <span style='font-size: 18px'>All</span> </label> </li> <?php foreach ($cats as $key => $value): $childs = get_term_children( $value->term_id, 'product_cat' ); $isChildOpen = false; if(!empty($childs)): foreach($childs as $child): $child = get_term_by('id',$child,'product_cat'); //print_r($category); if($category == $child->slug){ $isChildOpen = true; break; } endforeach; endif; ?> <li class="<?php if(!empty($childs)) echo 'has-child'; ?>"> <?php if(!empty($childs)):?> <div class="custom-checkbox"> <?php else: ?> <label class="custom-checkbox"> <?php endif;?> <input class="filter-checkbox" type="checkbox" name="category" value="<?php echo $value->slug ?>" <?php if($category == $value->slug) echo 'checked' ?> /> <span style='font-size: 18px'><?php echo $value->name ?> (<?php echo $value->count ?>)</span> <?php if(!empty($childs)):?> </div> <?php else: ?> </label> <?php endif;?> <?php if(!empty($childs)): ?> <ul class="customShopGrid-filter-group-content-child" style="<?php if(!$isChildOpen) echo 'display: none;'?>"> <?php foreach($childs as $child): $child = get_term_by('id',$child,'product_cat'); if($child->count > 0): ?> <li> <label class="custom-checkbox"> <input class="filter-checkbox" type="checkbox" name="category" value="<?php echo $child->slug ?>" <?php if($category == $child->slug) echo 'checked' ?> /> <span style='font-size: 18px'><?php echo $child->name; ?> (<?php echo $child->count ?>)</span> </label> </li> <?php endif; endforeach ?> </ul> <?php endif;?> </li> <?php endforeach ?> </ul> </div> </div> <!--end group--> <?php endif; ?> <div class="customShopGrid-filter-reset"> <a class="customShopGrid-filter-reset-button" href="<?php echo get_permalink( wc_get_page_id( 'shop' ) )?>">Reset Filters</a> </div> </div> </div> </div> <div class="customShopGrid-right"> <div class="customShopGrid-order show-mb-flex" hidden> <h3 class="customShopGrid-filter-heading">Sort by:</h3> <div class="orderbyMB"> </div> </div> <!--end group--> <?php if ( !empty($keyword) ) :?> <p class="customShopGrid-seach-keyword-label">Search results for <span>"<?php echo $keyword; ?>"</span> <a href="https://vancitylabs.co/shop/">Remove</a></p> <?php endif; ?> <div class="customShopGrid-list"> <?php if ( $the_query->have_posts() ) :?> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <div class="customShopGrid-product"> <div class="customShopGrid-product-inner"> <div class="customShopGrid-product-image-wrap"> <?php $product = wc_get_product(get_the_ID()); $product_type = $product->get_type(); if(!$product->is_in_stock()): ?> <span class="customShopGrid-product-stockout customShopGrid-product-label">Out of stock</span> <?php endif; ?> <?php if(is_product_on_sale(get_the_ID())):?> <span class="customShopGrid-product-has-sale customShopGrid-product-label">Sale</span> <?php endif; ?> <div class="customShopGrid-product-image"> <a href="<?php the_permalink();?>" tabindex="0"> <?php the_post_thumbnail('medium')?> </a> </div> </div> <div class="customShopGrid-product-content"> <div class="customShopGrid-product-content-inner"> <div class="customShopGrid-product-ratting-wrap"> <div class="top-rated-rating"> <?php $types = get_the_terms(get_the_ID(),'product-type'); $type = ''; if(!empty($types)) $type = reset($types); if(is_object($type)): $color = get_field('color',$type); ?> <span class="customShopGrid-product-type" style="<?php if($color) echo 'background:'.$color;?>"><?php echo $type->name;?></span> <?php endif; ?> <span class="customShopGrid-product-ratting"> <span class="customShopGrid-product-user-ratting"> <?php customRatingScoreHTML(get_the_ID());?> </span> <span class="customShopGrid-product-user-ratting-count" hidden>(<?php echo $product->get_rating_count(); ?>)</span> </span> <?php $thc = get_field('thc'); if($thc > 0): ?> <span class="customShopGrid-product-thc"><b>THC</b> <?php echo $thc.'%'?></span> <?php endif; ?> </div> </div> <h4 class="customShopGrid-product-title"><a href="<?php the_permalink();?>" tabindex="0"><?php the_title();?></a></h4> <?php $add_to_card_id = get_the_ID(); $discounted_variants = get_discounted_variants_of_product(get_the_ID()); if($discounted_variants): $add_to_card_id = $discounted_variants[0]['id']; ?> <select class="customShopGrid-product-list-variable"> <?php foreach($discounted_variants as $key => $value): //print_r($value); $variable_price = ($value['sale_price']> 0)?$value['sale_price'] : $value['regular_price']; $name_parts = explode(' - ', $value['name']); //$variable_price = 0; ?> <option value="<?php echo $value['id']?>" <?php if(strtolower(end($name_parts)) == '28g'){$add_to_card_id = $value['id']; echo 'selected';}?>><?php echo end($name_parts);?> - $<?php echo $variable_price;?></option> <?php endforeach;?> </select> <?php else: ?> <div class="customShopGrid-product-price"> <?php woocommerce_template_loop_price();?> </div> <?php endif;?> <div class="wrap-btn"> <?php if($product_type !== 'bundle'):?> <a class="pb-btn-style add_to_cart_button ajax_add_to_cart" href="<?php site_url();?>?add-to-cart=<?php echo $add_to_card_id;?>&quantity=1" data-quantity="1" data-product_id="<?php echo $add_to_card_id;?>"><span>Add to cart</span> <img src="https://vancitylabs.co/wp-content/uploads/2024/04/right-arrow.svg" /></a> <?php else: ?> <a class="pb-btn-style" href="<?php the_permalink(); ?>"><span>Buy Now</span> <img src="https://vancitylabs.co/wp-content/uploads/2024/04/right-arrow.svg" /></a> <?php endif;?> </div> </div> </div> </div> </div> <?php endwhile;?> <?php else: ?> <p>No product found!</p> <?php endif;wp_reset_postdata();?> </div> <?php if($the_query->max_num_pages > 1):?> <div class="customShopGrid-pagenavi"> <?php echo paginate_links(array( 'total' => $the_query->max_num_pages, 'current' => $paged, 'prev_text' => '<img src="'.CHILD_THEME_URI.'/images/prev-arrow-green.svg" />', 'next_text' => '<img src="'.CHILD_THEME_URI.'/images/next-arrow-green.svg" />' ));?> </div> <?php endif;?> </div> </div> </div> </form> <script type="text/javascript"> (function($){ var sortDiv = $('body').find('#orderby'); //var spinner = $('') $('body').on('change','.filter-checkbox',function(){ $(this).parents('li').siblings().find('.filter-checkbox').prop('checked', false) $('#frmFilterProduct').submit(); }) $('body').on('click','.customShopGrid-filter-group-head',function(e){ $(this).toggleClass('close') $(this).parent().find('.customShopGrid-filter-group-content').slideToggle(); }) $('body').on('change','.slOrder',function(){ $('#frmFilterProduct').submit(); }) $('body').on('click','.customShopGrid-filter-top',function(e){ $(this).toggleClass('close') $(this).parent().find('.customShopGrid-filter-list').slideToggle(); }) $('body').on('click','li.has-child .custom-checkbox',function(e){ var $div = $(this); var divOffset = $div.offset(); var clickX = e.pageX - divOffset.left; if (clickX <= 28) { $(this).parents('ul').find('.filter-checkbox').prop('checked', false); $(this).find('.filter-checkbox').prop('checked', true) $('#frmFilterProduct').submit(); } else{ $(this).parent().find('.customShopGrid-filter-group-content-child').slideToggle(); } }) function moveSortDiv(){ if($(window).innerWidth() < 768){ if(!$('.orderbyMB .slOrder').length) sortDiv.appendTo('.orderbyMB'); } else{ if(!$('.orderbyPC .slOrder').length) sortDiv.appendTo('.orderbyPC'); } } moveSortDiv(); $(window).on('resize',function(){ moveSortDiv(); }) function customAjaxSend(form,fullUrl){ history.pushState({}, '', fullUrl); $.ajax({ url: fullUrl, method: form.attr('method'), data: form.serialize(), dataType: 'html', beforeSend: function () { $('.customShopGrid-list').html(`<div class="cspinner"> <div class="loadingio-spinner" style="/* display: none; */"> <div class="loadingio-spinner-spinner-gakt1tin5n"> <div class="ldio-7ufvexzivn"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> </div> </div> </div>`); $('.cspinner .loadingio-spinner').show(); $('.customShopGrid-pagenavi').css('display','none'); }, success: function(response) { const html = $(response); const items = html.find('.frmFilterProduct-ajax'); $('#frmFilterProduct').html(items); $('.cspinner .loadingio-spinner').hide(); $('.customShopGrid-pagenavi').css('display','flex'); // if (items.length) { // $('.project-box').html(items); // } else { // $('.project-box').html('<p>Aucun résultat trouvé</p>'); // } //console.log(response); moveSortDiv(); }, error: function(jqXHR, textStatus, errorThrown) { console.log('Error submitting form'); console.log(textStatus, errorThrown); } }); } $('#frmFilterProduct').on('submit', function(e) { e.preventDefault(); var form = $(this); var url = form.attr('action'); var fullUrl = url + '?' + form.serialize(); history.pushState({}, '', fullUrl); let currentUrl = window.location.href; let newUrl = currentUrl.replace(/page\/\d+\//, ''); customAjaxSend(form, newUrl); }); $('body').on('click','.customShopGrid-pagenavi a',function(e){ e.preventDefault(); var form = $('#frmFilterProduct'); var fullUrl = $(this).attr('href'); $('html, body').animate({ scrollTop: $(".customShopGrid-right").offset().top - 300 }, 1000); // 1000 milliseconds for the scroll animation customAjaxSend(form, fullUrl); // setTimeout(function() { // }, 200); // 1000 milliseconds delay before starting the scroll }) })(jQuery) </script> </div> <?php return ob_get_clean(); } add_shortcode('customShopGrid','customShopGridShortcode');
<head> <meta charset="<?php bloginfo('charset'); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="preconnect" href="https://fonts.googleapis.com/" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <link rel="stylesheet" href="https://unpkg.com/tippy.js@6/dist/tippy.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11.0.5/swiper-bundle.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-range@1.0.0/jquery.range.min.css" /> <link rel="stylesheet" href="https://unpkg.com/intl-tel-input@18.2.1/build/css/intlTelInput.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/flatpickr.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lazyload@17.8.5/dist/lazyload.min.js" /> <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/tvh-custom.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/tvh-custom.css') ?>" /> <script defer src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> <script defer src="https://unpkg.com/@popperjs/core@2"></script> <script defer src="https://cdn.jsdelivr.net/npm/swiper@11.0.5/swiper-bundle.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/jquery-range@1.0.0/jquery.range-min.js"></script> <script defer src="https://unpkg.com/intl-tel-input@18.2.1/build/js/intlTelInput.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/flatpickr.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.8.5/dist/lazyload.min.js"></script> <link rel="profile" href="https://gmpg.org/xfn/11" /> <?php if (is_page_template('template-home.php')): ?> <link rel="preload stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/home.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/home.css') ?>" as="style"> <link rel="preload" fetchpriority="high" href="<?php echo get_template_directory_uri() . '/assets/img/home-hero.webp'; ?>" type="image/webp"> <?php endif; ?> <?php if (is_page_template('template-about.php')): ?> <link rel="preload stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/about-us.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/about-us.css') ?>" as="style"> <?php endif; ?> <?php if (is_page_template('template-services.php')): ?> <link rel="preload stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/about-us.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/about-us.css') ?>" as="style"> <?php endif; ?> </head>
function customRatingScoreHTML($productID) { $product = wc_get_product($productID); $average = $product->get_average_rating(); $rating_whole = floor($average); $rating_fraction = $average - $rating_whole; $flug = 0; for ($i = 1; $i <= 5; $i++) { if ($i <= $rating_whole) { echo '<i class="fas fa-star"></i>'; } else { if ($rating_fraction > 0 && $flug == 0) { echo '<i class="fas fa-star-half-alt"></i>'; $flug = 1; } else { echo '<i class="far fa-star empty"></i>'; } } } }
<?php /** * Review order table * * This template can be overridden by copying it to yourtheme/woocommerce/checkout/review-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 5.2.0 */ defined( 'ABSPATH' ) || exit; $total_order = WC()->cart->total; $total_sale = 0; foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $product = $cart_item['data']; if ( $product->is_on_sale() ) { $total_sale += ( $product->get_regular_price() - $product->get_sale_price() ) * $cart_item['quantity']; } } ?> <div class="woocommerce-checkout-review-order-table"> <?php do_action('custom-freeshiping-bar');?> <div id="total-header"> <button type="button" id="toggle-cart-items" class="button-toggle-cart"> Order Summary <i class="fa-solid fa-chevron-down"></i> </button> <div class="total-money"> <span class="total-sale">$<?php echo number_format($total_sale, 2); ?></span> <span class="total-order">$<?php echo number_format($total_order, 2); ?></span> </div> </div> <div id="cart-details"> <div class="title-in-review"> <h3 class="co-h3">PURCHARE SUMMARY</h3> <?php do_action('custom-freeshiping-bar');?> </div> <ul id="cart-items-list" class="woocommerce-mini-cart cart_list product_list_widget"> <?php if ( ! WC()->cart->is_empty() ) : ?> <?php do_action( 'woocommerce_review_order_before_cart_contents' ); foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) { $product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ); $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); $product_price = apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); if ( empty( $product_permalink ) ) { $product_name = '<span class="nm-cart-panel-product-title">' . wp_kses_post( $product_name ) . '</span>'; } else { $product_permalink = esc_url( $product_permalink ); $thumbnail = '<a href="' . $product_permalink . '">' . $thumbnail . '</a>'; $product_name = '<a href="' . $product_permalink . '" class="nm-cart-panel-product-title">' . wp_kses_post( $product_name ) . '</a>'; } $product = wc_get_product($product_id); ?> <li id="nm-cart-panel-item-<?php echo esc_attr( $cart_item_key ); ?>" class="woocommerce-mini-cart-item <?php echo esc_attr( apply_filters( 'woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key ) ); ?>"> <div class="nm-cart-panel-item-thumbnail"> <div class="nm-cart-item-loader nm-loader"></div> <div class="nm-cart-panel-thumbnail-wrap"> <?php echo $thumbnail; ?> <div class="nm-cart-panel-thumbnail-loader nm-loader"></div> </div> </div> <div class="nm-cart-panel-item-details"> <?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="remove remove_from_cart_button" aria-label="%s" data-product_id="%s" data-cart_item_key="%s" data-product_sku="%s"><i class="nm-font nm-font-close2"></i></a>', esc_url( wc_get_cart_remove_url( $cart_item_key ) ), esc_attr( sprintf( __( 'Remove %s from cart', 'woocommerce' ), wp_strip_all_tags( $product_name ) ) ), esc_attr( $product_id ), esc_attr( $cart_item_key ), esc_attr( $_product->get_sku() ) ), $cart_item_key ); ?> <?php echo $product_name; ?> <?php echo wc_get_formatted_cart_item_data( $cart_item ); ?> <div class="nm-cart-panel-quantity-pricing"> <?php if ( $_product->is_sold_individually() ) : ?> <?php echo apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . esc_html__( 'Qty', 'woocommerce' ) . ': ' . $cart_item['quantity'] . '</span>', $cart_item, $cart_item_key ); ?> <?php else: ?> <div class="product-quantity" data-title="<?php esc_html_e( 'Quantity', 'woocommerce' ); ?>"> <?php $product_quantity = woocommerce_quantity_input( array( 'input_name' => "cart[{$cart_item_key}][qty]", 'input_value' => $cart_item['quantity'], 'max_value' => $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(), 'min_value' => '1', 'nm_mini_cart_quantity' => true ), $_product, false ); echo apply_filters( 'woocommerce_widget_cart_item_quantity', $product_quantity, $cart_item, $cart_item_key ); ?> </div> <?php endif; ?> <div class="nm-cart-panel-item-price"> <?php if ( $price_html = $product->get_price_html() ) : ?> <span class="price"><?php echo $price_html; ?></span> <?php endif; ?> </div> </div> </div> </li> <?php } } do_action( 'woocommerce_review_order_after_cart_contents' ); ?> <?php else: ?> <li class="empty"> <i class="nm-font nm-font-close2"></i> <span><?php esc_html_e( 'No products in the cart.', 'woocommerce' ); ?></span> </li> <?php endif; ?> </ul> <?php do_action( 'woocommerce_custom_checkout_counpon' ); ?> <table class="shop_table"> <tfoot> <tr class="cart-subtotal"> <th><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th> <td><?php wc_cart_totals_subtotal_html(); ?></td> </tr> <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?> <tr class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>"> <th><?php wc_cart_totals_coupon_label( $coupon ); ?></th> <td><?php wc_cart_totals_coupon_html( $coupon ); ?></td> </tr> <?php endforeach; ?> <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?> <?php // Get available shipping methods $available_methods = WC()->shipping->get_packages()[0]['rates']; $chosen_methods = WC()->session->get('chosen_shipping_methods'); $chosen_method = !empty($chosen_methods[0]) ? $chosen_methods[0] : ''; // Only display the chosen method if (!empty($available_methods[$chosen_method])) { echo '<tr class="shipping">'; echo '<th>' . esc_html__('Shipping', 'woocommerce') . '</th>'; echo '<td data-title="Shipping">' . wp_kses_post($available_methods[$chosen_method]->label . ': ' . wc_price($available_methods[$chosen_method]->cost)) . '</td>'; echo '</tr>'; } ?> <?php endif; ?> <?php foreach ( WC()->cart->get_fees() as $fee ) : ?> <tr class="fee"> <th><?php echo esc_html( $fee->name ); ?></th> <td><?php wc_cart_totals_fee_html( $fee ); ?></td> </tr> <?php endforeach; ?> <?php if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) : ?> <?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?> <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?> <tr class="tax-rate tax-rate-<?php echo esc_attr( sanitize_title( $code ) ); ?>"> <th><?php echo esc_html( $tax->label ); ?></th> <td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td> </tr> <?php endforeach; ?> <?php else : ?> <tr class="tax-total"> <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th> <td><?php wc_cart_totals_taxes_total_html(); ?></td> </tr> <?php endif; ?> <?php endif; ?> <?php do_action( 'woocommerce_review_order_before_order_total' ); ?> <tr class="order-total"> <th><?php esc_html_e( 'Total', 'woocommerce' ); ?></th> <td><?php wc_cart_totals_order_total_html(); ?></td> </tr> <?php do_action( 'woocommerce_review_order_after_order_total' ); ?> </tfoot> </table> </div> </div>
/** * @snippet Remove Zoom, Gallery @ Single Product Page * @how-to Get CustomizeWoo.com FREE * @author Rodolfo Melogli * @testedwith WooCommerce 5 * @community https://businessbloomer.com/club/ */ //add_action( 'wp', 'bbloomer_remove_zoom_lightbox_theme_support', 99 ); function bbloomer_remove_zoom_lightbox_theme_support() { //remove_theme_support( 'wc-product-gallery-zoom' ); //remove_theme_support( 'wc-product-gallery-lightbox' ); remove_theme_support( 'wc-product-gallery-slider' ); } ////Remove actions for single product remove_action('woocommerce_before_main_content','woocommerce_breadcrumb',20); remove_action('woocommerce_single_product_summary','woocommerce_template_single_meta',40); remove_action('woocommerce_single_product_summary','woocommerce_template_single_excerpt',20); remove_action('woocommerce_after_single_product_summary','woocommerce_output_product_data_tabs',10); remove_action('woocommerce_after_single_product_summary','woocommerce_upsell_display',15); remove_action('woocommerce_after_single_product_summary','woocommerce_output_related_products',20); //Add actions for single product add_action('woocommerce_single_product_summary','woocommerce_template_single_excerpt',35); function addTHCForSingleProduct(){ $thc = get_field('thc'); if(!empty($thc)) echo '<h4 class="single-product-thc">'.$thc.'</h4>'; } add_action('woocommerce_single_product_summary','addTHCForSingleProduct',6); function customTabForSingleProduct(){ ?> <div class="rst-accordion-description"> <?php if($ingredient = get_field('ingredient_field_name')):?> <div class="rst-item-accordion-description"> <h3 class="rst-heading-item-accordion-description rst-heading-item-toggle"> Ingredients <span> <img src="https://sweedies.co/wp-content/uploads/2024/05/arrows-down.png" /> </span> </h3> <div class="rst-content-item-accordion-description"> <?php echo $ingredient; ?> </div> </div> <?php endif;?> <?php $lab_test_report = get_field('lab_test_report');if(!empty($lab_test_report)):?> <div class="rst-item-accordion-description"> <a class="rst-heading-item-accordion-description" href="<?php echo $lab_test_report['url']; ?>" download> Lab test report <span> <img src="https://sweedies.co/wp-content/uploads/2024/05/PDF-Print-Icon.png" /> </span> </a> </div> <?php endif;?> </div> <script> (function($){ $('.rst-heading-item-toggle').click(function(){ if($(this).hasClass('active')){ $(this).parent().find('.rst-content-item-accordion-description').slideUp(); $(this).removeClass('active'); }else{ $('.rst-content-item-accordion-description').slideUp(); $(this).parent().find('.rst-content-item-accordion-description').slideDown(); $('.rst-heading-item-toggle').removeClass('active'); $(this).addClass('active'); } return false; }); })(jQuery) </script> <?php } add_action('woocommerce_single_product_summary','customTabForSingleProduct',45); function customBestSellerForShop(){ ?> <?php $args = [ 'post_type' => 'product', 'posts_per_page' => 15, 'meta_key' => 'total_sales', 'orderby' => 'meta_value_num', 'order' => 'DESC', ]; $the_query = new WP_Query($args); if($the_query->have_posts()): ?> <div class="customBestSellerForSingleProduct" style="clear: both;"> <div class="customBestSellerForSingleProduct-head"> <h2 class="nt-heading"> Best Sellers </h2> </div> <div class="customBestSellerForSingleProduct-list"> <div class="slider-product custom-slider-product-bestSellers"> <div class="swiper-wrapper"> <?php while ($the_query->have_posts()): $the_query->the_post(); $product = wc_get_product(get_the_ID()); $categories = wp_get_post_terms(get_the_ID(), 'product_cat'); $category_name = !empty($categories) ? $categories[0]->name : ''; $rating_count = $product->get_rating_count(); $average = $product->get_average_rating(); $regular_price = $product->get_regular_price(); $sale_price = $product->get_sale_price(); ?> <div class="swiper-slide"> <div class="slider-product-item"> <a class="product-link" href="<?php the_permalink(); ?>"> <div class="slider-product-image"> <?php echo woocommerce_get_product_thumbnail('shop_catalog'); ?> <div class="add-to-cart-btn"> <?php //echo $this->get_add_to_cart_button(get_the_ID()); ?> </div> </div> </a> <div class="slider-product-details"> <div class="product-category"><?php echo esc_html($category_name); ?></div> <a href="<?php the_permalink(); ?>"> <h2 class="slider-product-title"> <?php the_title(); ?> </h2> </a> <div class="slider-product-description"><?php echo wp_trim_words(get_the_excerpt(), 15); ?></div> <div class="product-rating"> <?php $rating = $average; $full_stars = floor($rating); $half_star = ($rating - $full_stars >= 0.5) ? 1 : 0; $empty_stars = 5 - $full_stars - $half_star; for ($i = 0; $i < $full_stars; $i++) { echo '<i class="fa-solid fa-star"></i>'; } if ($half_star) { echo '<i class="fa-solid fa-star-half-alt"></i>'; } for ($i = 0; $i < $empty_stars; $i++) { echo '<i class="fa-regular fa-star"></i>'; } ?> <span class="rating-count">(<?php echo $rating_count; ?>)</span> </div> <div class="slider-product-prices"> <?php if ($sale_price): ?> <span class="slider-product-new-price"><?php echo wc_price($sale_price); ?></span> <span class="slider-product-old-price"><?php echo wc_price($regular_price); ?></span> <?php else: ?> <span class="slider-product-new-price"><?php echo wc_price($regular_price); ?></span> <?php endif; ?> </div> </div> </div> </div> <?php endwhile; ?> </div> <div class="swiper-pagination"></div> </div> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> </div> </div> <script> jQuery(document).ready(function ($) { var swiper_bestSellers = new Swiper(".custom-slider-product-bestSellers", { slidesPerView: 3, slidesPerGroup: 1, centeredSlides: true, loop: true, autoplay: { delay: 5000, }, spaceBetween: 24, // pagination: { // el: ".swiper-pagination", // clickable: true, // }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, breakpoints: { 1025: { slidesPerView: 3, centeredSlides: true, }, 768: { slidesPerView: 2, centeredSlides: true, }, 320: { slidesPerView: 1.5, centeredSlides: true, }, } }); }); jQuery(document).ready(function($) { $('.slider-product .slider-product-item ').matchHeight(); }); </script> <?php endif; wp_reset_postdata(); } add_action('woocommerce_after_single_product','customBestSellerForSingleProduct',25); function customReviewForSingleProduct(){ ?> <div class="customReviewForSingleProduct"> <div class="customReviewForSingleProduct-head"> <h2 class="nt-heading"> Customer reviews </h2> </div> <div class="customReviewForSingleProduct-content"> <?php echo do_shortcode('[Woo_stamped_io type="widget"]');?> </div> </div> <?php } add_action('woocommerce_after_single_product','customBestSellerForShop',30);
<?php class Elementor_Custom_Video_Widget extends \Elementor\Widget_Base { public function get_name() { return 'custom_video_widget'; } public function get_title() { return __('Custom Video Widget', 'plugin-name'); } public function get_icon() { return 'eicon-video-camera'; } public function get_categories() { return ['basic']; } protected function _register_controls() { $this->start_controls_section( 'content_section', [ 'label' => __('Content', 'plugin-name'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'source', [ 'label' => __('Source', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ 'self_hosted' => __('Self Hosted', 'plugin-name'), 'external' => __('External URL', 'plugin-name'), ], 'default' => 'self_hosted', ] ); $this->add_control( 'video_url', [ 'label' => __('Choose Video File', 'plugin-name'), 'type' => \Elementor\Controls_Manager::MEDIA, 'media_type' => 'video', 'condition' => [ 'source' => 'self_hosted', ], ] ); $this->add_control( 'autoplay', [ 'label' => __('Autoplay', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'plugin-name'), 'label_off' => __('No', 'plugin-name'), 'return_value' => 'yes', 'default' => 'yes', // Set default to 'yes' ] ); $this->add_control( 'play_on_mobile', [ 'label' => __('Play on Mobile', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'plugin-name'), 'label_off' => __('No', 'plugin-name'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'mute', [ 'label' => __('Mute', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'plugin-name'), 'label_off' => __('No', 'plugin-name'), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'loop', [ 'label' => __('Loop', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'plugin-name'), 'label_off' => __('No', 'plugin-name'), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'player_controls', [ 'label' => __('Player Controls', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Show', 'plugin-name'), 'label_off' => __('Hide', 'plugin-name'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'download_button', [ 'label' => __('Download Button', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Show', 'plugin-name'), 'label_off' => __('Hide', 'plugin-name'), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'poster', [ 'label' => __('Poster', 'plugin-name'), 'type' => \Elementor\Controls_Manager::MEDIA, 'media_type' => 'image', ] ); $this->add_control( 'show_play_button', [ 'label' => __('Show Play/Pause Button', 'plugin-name'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Show', 'plugin-name'), 'label_off' => __('Hide', 'plugin-name'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); // Video HTML echo '<video id="custom-video" src="' . $settings['video_url']['url'] . '" ' . ($settings['autoplay'] === 'yes' ? 'autoplay' : '') . ' ' . ($settings['mute'] === 'yes' ? 'muted' : '') . ' ' . ($settings['loop'] === 'yes' ? 'loop' : '') . ' ' . ($settings['player_controls'] === 'yes' ? 'controls' : '') . ' poster="' . $settings['poster']['url'] . '"></video>'; // Play/Pause Button if ($settings['show_play_button'] === 'yes') { // Default to pause icon if autoplay is enabled $icon_class = $settings['autoplay'] === 'yes' ? 'fa-pause' : 'fa-play'; echo '<button id="custom-play-pause" class="play-button"><i class="fas ' . $icon_class . '"></i></button>'; } // JavaScript for Play/Pause Button echo '<script> document.addEventListener("DOMContentLoaded", function() { var video = document.getElementById("custom-video"); var playPauseButton = document.getElementById("custom-play-pause"); var icon = playPauseButton.querySelector("i"); // Play video if autoplay is enabled and video is muted (required by some browsers) video.addEventListener("loadedmetadata", function() { if (video.hasAttribute("autoplay")) { video.play().then(function() { icon.classList.remove("fa-play"); icon.classList.add("fa-pause"); }).catch(function(error) { console.log("Autoplay failed: ", error); icon.classList.remove("fa-pause"); icon.classList.add("fa-play"); }); } }); playPauseButton.addEventListener("click", function() { if (video.paused) { video.play(); icon.classList.remove("fa-play"); icon.classList.add("fa-pause"); } else { video.pause(); icon.classList.remove("fa-pause"); icon.classList.add("fa-play"); } }); }); </script>'; } } //-------------------------------------------------END-------------------------------------// Dưới đây là đoạn đăng ký widget function register_custom_widget($widgets_manager) { // Custom video widget require_once(__DIR__ . '/widgets/custom-video.php'); $widgets_manager->register(new \Elementor_Custom_Video_Widget()); } add_action('elementor/widgets/register', 'register_custom_widget');
<?php class Product_Search_Widget extends \Elementor\Widget_Base { public function get_name() { return 'product-search-widget'; } public function get_title() { return __('Product Search Widget', 'text-domain'); } public function get_icon() { return 'eicon-search'; } public function get_categories() { return ['general']; } protected function render() { ?> <form class="pp-search-form" role="search" action="<?php echo esc_url(home_url('/')); ?>" method="get" aria-label="Search form"> <div class="pp-search-form__toggle"> <i class="fa fa-search" aria-hidden="true"></i> </div> <div class="pp-search-form__container pp-search-form--lightbox"> <div class="search-form"> <label class="pp-screen-reader-text" for="pp-search-form__input-<?php echo esc_attr($this->get_id()); ?>"> Search our products </label> <input id="pp-search-form__input-<?php echo esc_attr($this->get_id()); ?>" class="pp-search-form__input" type="search" name="s" title="Search" value=""> </div> <button type="submit" class="pp-search-form__button"> <span class="pp-icon-search" aria-hidden="true"> <i class="fa fa-search" aria-hidden="true"></i> </span> </button> <input type="hidden" name="post_type" value="product"> <div class="pp-search-form--lightbox-close"> <span class="pp-icon-close" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg> </span> </div> </div> </form> <?php } } \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Product_Search_Widget());
<?php /** * The Template for displaying product archives, including the main shop page which is a post type archive * * This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 3.4.0 */ defined( 'ABSPATH' ) || exit; get_header( 'shop' ); /** * Hook: woocommerce_before_main_content. * * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) * @hooked woocommerce_breadcrumb - 20 * @hooked WC_Structured_Data::generate_website_data() - 30 */ do_action( 'woocommerce_before_main_content' ); ?> <div class="container-fluid"> <header class="woocommerce-products-header"> <?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?> <h1 class="woocommerce-products-header__title page-title"><?php woocommerce_page_title(); ?></h1> <?php endif; ?> <?php /** * Hook: woocommerce_archive_description. * * @hooked woocommerce_taxonomy_archive_description - 10 * @hooked woocommerce_product_archive_description - 10 */ do_action( 'woocommerce_archive_description' ); ?> </header> <div class="row"> <div class="col-lg-3"> <?php /** * Hook: woocommerce_sidebar. * * @hooked woocommerce_get_sidebar - 10 */ do_action( 'woocommerce_sidebar' ); ?> </div> <div class="col-lg-9"> <?php if ( woocommerce_product_loop() ) { /** * Hook: woocommerce_before_shop_loop. * * @hooked woocommerce_output_all_notices - 10 * @hooked woocommerce_result_count - 20 * @hooked woocommerce_catalog_ordering - 30 */ do_action( 'woocommerce_before_shop_loop' ); woocommerce_product_loop_start(); if ( wc_get_loop_prop( 'total' ) ) { while ( have_posts() ) { the_post(); /** * Hook: woocommerce_shop_loop. */ do_action( 'woocommerce_shop_loop' ); wc_get_template_part( 'content', 'product' ); } } woocommerce_product_loop_end(); /** * Hook: woocommerce_after_shop_loop. * * @hooked woocommerce_pagination - 10 */ do_action( 'woocommerce_after_shop_loop' ); } else { /** * Hook: woocommerce_no_products_found. * * @hooked wc_no_products_found - 10 */ do_action( 'woocommerce_no_products_found' ); } /** * Hook: woocommerce_after_main_content. * * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) */ do_action( 'woocommerce_after_main_content' ); ?> </div> </div> </div> <?php get_footer( 'shop' ); ?>
function custom_mini_cart() { if ( function_exists('WC') && WC()->cart ) { ?> <div class="custom-mini-cart"> <a class="cart-contents" href="#" title="<?php _e( 'View your shopping cart', 'text-domain' ); ?>"> <svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="#000000" class="bi bi-cart2"> <path d="M0 2.5A.5.5 0 0 1 .5 2H2a.5.5 0 0 1 .485.379L2.89 4H14.5a.5.5 0 0 1 .485.621l-1.5 6A.5.5 0 0 1 13 11H4a.5.5 0 0 1-.485-.379L1.61 3H.5a.5.5 0 0 1-.5-.5zM3.14 5l1.25 5h8.22l1.25-5H3.14zM5 13a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0zm9-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0z"/> </svg> <span class="cart-contents-count"><?php echo WC()->cart->get_cart_contents_count(); ?></span> </a> <div class="widget_shopping_cart_content"> <?php woocommerce_mini_cart(); ?> </div> </div> <?php } else { echo '<p>' . __( 'Cart is empty.', 'text-domain' ) . '</p>'; } } add_shortcode('custom_mini_cart', 'custom_mini_cart'); function add_to_cart_fragment( $fragments ) { if ( function_exists('WC') && WC()->cart ) { ob_start(); ?> <span class="cart-contents-count"><?php echo WC()->cart->get_cart_contents_count(); ?></span> <?php $fragments['.cart-contents-count'] = ob_get_clean(); } return $fragments; } add_filter( 'woocommerce_add_to_cart_fragments', 'add_to_cart_fragment' );
<head> <meta charset="<?php bloginfo('charset'); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="preconnect" href="https://fonts.googleapis.com/" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <link rel="stylesheet" href="https://unpkg.com/tippy.js@6/dist/tippy.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11.0.5/swiper-bundle.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-range@1.0.0/jquery.range.min.css" /> <link rel="stylesheet" href="https://unpkg.com/intl-tel-input@18.2.1/build/css/intlTelInput.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/flatpickr.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lazyload@17.8.5/dist/lazyload.min.js" /> <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/tvh-custom.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/tvh-custom.css') ?>" /> <script defer src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> <script defer src="https://unpkg.com/@popperjs/core@2"></script> <script defer src="https://cdn.jsdelivr.net/npm/swiper@11.0.5/swiper-bundle.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/jquery-range@1.0.0/jquery.range-min.js"></script> <script defer src="https://unpkg.com/intl-tel-input@18.2.1/build/js/intlTelInput.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/flatpickr.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.8.5/dist/lazyload.min.js"></script> <link rel="profile" href="https://gmpg.org/xfn/11" /> <?php if (is_page_template('template-home.php')): ?> <link rel="preload stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/home.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/home.css') ?>" as="style"> <link rel="preload" fetchpriority="high" href="<?php echo get_template_directory_uri() . '/assets/img/home-hero.webp'; ?>" type="image/webp"> <?php endif; ?> <?php if (is_page_template('template-about.php')): ?> <link rel="preload stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/about-us.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/about-us.css') ?>" as="style"> <?php endif; ?> <?php if (is_page_template('template-services.php')): ?> <link rel="preload stylesheet" href="<?php echo get_stylesheet_directory_uri() . '/assets/css/about-us.css?ver=' . filemtime(get_stylesheet_directory() . '/assets/css/about-us.css') ?>" as="style"> <?php endif; ?> </head>
<div class="panel panel-primary" style="float:right;margin:0 0 1em 2em;width:250px;"> <div class="panel-body"> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="Person" src="https://www.clackamas.us/sites/default/files/bcc/in-person.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Attend in person</strong><br> BCC Hearing Room<br> 2051 Kaen Road<br> Room 409<br> Oregon City, OR <a href="http://maps.google.com/maps?q=2051%20Kaen%20Road%20Oregon%20City%2C%20OR%2097045&c=45.3329205302%20-122.598746346">map</a> </p> </div> </div> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="Videoconferencing" src="https://www.clackamas.us/sites/default/files/bcc/video.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Attend virtually</strong><br> <a href="https://clackamascounty.zoom.us/j/88450537689" target="_blank">Join this meeting</a> </p> </div> </div> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="YouTube logo" src="https://www.clackamas.us/sites/default/files/bcc/youtube.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Watch live</strong><br> Via our <a href="https://www.youtube.com/clackamascounty/live" target="_blank">YouTube channel</a>. </p> </div> </div> </div> </div>
<div class="panel panel-primary" style="float:right;margin:0 0 1em 2em;width:250px;"> <div class="panel-body"> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="Person" src="https://www.clackamas.us/sites/default/files/bcc/in-person.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Attend in person</strong><br> BCC Hearing Room<br> 2051 Kaen Road<br> Room 409<br> Oregon City, OR <a href="http://maps.google.com/maps?q=2051%20Kaen%20Road%20Oregon%20City%2C%20OR%2097045&c=45.3329205302%20-122.598746346">map</a> </p> </div> </div> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="Videoconferencing" src="https://www.clackamas.us/sites/default/files/bcc/video.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Attend virtually</strong><br> <a href="https://clackamascounty.zoom.us/j/88604828752" target="_blank">Join this meeting</a> </p> </div> </div> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="YouTube logo" src="https://www.clackamas.us/sites/default/files/bcc/youtube.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Watch live</strong><br> Via our <a href="https://www.youtube.com/clackamascounty/live" target="_blank">YouTube channel</a>. </p> </div> </div> </div> </div>
<div class="panel panel-primary" style="float:right;margin:0 0 1em 2em;width:250px;"> <div class="panel-body"> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="Person" src="https://www.clackamas.us/sites/default/files/bcc/in-person.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Attend in person</strong><br> BCC Hearing Room<br> 2051 Kaen Road<br> Room 409<br> Oregon City, OR <a href="http://maps.google.com/maps?q=2051%20Kaen%20Road%20Oregon%20City%2C%20OR%2097045&c=45.3329205302%20-122.598746346">map</a> </p> </div> </div> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="Videoconferencing" src="https://www.clackamas.us/sites/default/files/bcc/video.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Attend virtually</strong><br> <a href="https://clackamascounty.zoom.us/webinar/register/WN_gPl62j3nRNupIAL10ZKwNQ" target="_blank">Register for this meeting</a> </p> </div> </div> <div class="row"> <div class="col-md-3 text-center" style="padding:10px;"> <img alt="YouTube logo" src="https://www.clackamas.us/sites/default/files/bcc/youtube.png"> </div> <div class="col-md-9" style="padding:10px;"> <p> <strong>Watch live</strong><br> Via our <a href="https://www.youtube.com/clackamascounty/live" target="_blank">YouTube channel</a>. </p> </div> </div> </div> </div>
<div class="panel panel-primary" style="width: 250px; float: right; margin: 0 0 1em 2em;"> <div class="panel-body"> <!-- IN PERSON --> <div class="row"> <div class="col-md-3 text-center" style="padding: 10px;"><img alt="Person" src="https://www.clackamas.us/sites/default/files/bcc/in-person.png" /></div> <div class="col-md-9" style="padding: 10px;"> <p><strong>Attend in person</strong><br /> BCC Hearing Room<br /> 2051 Kaen Road<br /> Room 409 <br /> Oregon City, OR <a href="http://maps.google.com/maps?q=2051%20Kaen%20Road%20Oregon%20City%2C%20OR%2097045&c=45.3329205302%20-122.598746346" target="_blank">map</a></p> </div> </div> <!-- VIRTUAL --> <div class="row"> <div class="col-md-3 text-center" style="padding: 10px;"><img alt="Videoconferencing" src="https://www.clackamas.us/sites/default/files/bcc/video.png" /></div> <div class="col-md-9" style="padding: 10px;"> <p><strong>Attend virtually</strong><br /> <a href="https://clackamascounty.zoom.us/webinar/register/WN_pVtSEzPuS7CYmEt1qnmc9A" target="_blank">Join this meeting</a><br /> Webinar ID: <em>### #### ####</em><br /> Passcode: <em>######</em><br /> Phone: <em>###-###-####</em></p> </div> </div> <!-- STREAM ON YOUTUBE --> <div class="row"> <div class="col-md-3 text-center" style="padding: 10px;"><img alt="YouTube logo" src="https://www.clackamas.us/sites/default/files/bcc/youtube.png" /></div> <div class="col-md-9" style="padding: 10px;"> <p><strong>Watch live</strong><br /> Via our <a href="https://www.youtube.com/clackamascounty/live" target="_blank">YouTube channel</a>.</p> </div> </div> </div> </div>
// Challenge Solution - Part #4 // Add Challenge Color - Soft-White Triangle 0x888888, // soft white triangle
// Challenge Solution - Part #3 // Add Challenge Element Name piece_Tri,
repositories { maven { url 'https://maven.wortise.com/artifactory/public' } maven { url 'https://android-sdk.is.com/' } maven { url 'https://artifact.bytedance.com/repository/pangle' } }
// Challenge Solution - Part #2 // Challenge Element "Triangle" const char piece_Tri[] = { // Rotation 1 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, // Rotation 2 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, // Rotation 3 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, // Rotation 4 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, }; // End Challenge Element
#define NUM_ELEMENT_TYPES 8 // Challenge Solution - Part #1 - Add 1 for Number of Element Types
GET /api/v1/users/123
You can remove the Search-by switch option from the page settings here https://fareharbor.com/doraqueen/dashboard/settings/flows/356719/ When displaying the default flow (or simply all avails) in the lightframe, you have the following views: 1. The regular flow grid 2. The large calendar with all avails 3. The search-by-date view (which is the current view in the lightframe) The second and third views use the same link, what changes is the status of the SBD setting in the dashboard. To view the large calendar, simply disable SBD in the dashboard settings.
class NW_EmailAssetTransferRequestController extends SrsReportRunController { public static void main(args _args) { NW_EmailAssetTransferRequestContract contract = new NW_EmailAssetTransferRequestContract(); SRSPrintDestinationSettings settings; SrsReportEMailDataContract emailContract; AssetTransferRequest _AssetTransferRequest; System.IO.MemoryStream _stream; SysMailerMessageBuilder mailer = new SysMailerMessageBuilder(); SysMailerSMTP smtp = new SysMailerSMTP(); Filename fileName; Array arrayFiles; System.Byte[] reportBytes = new System.Byte[0](); SRSProxy srsProxy; SRSReportRunService srsReportRunService = new SrsReportRunService(); Microsoft.Dynamics.AX.Framework.Reporting.Shared.ReportingService.ParameterValue[] parameterValueArray; Map reportParametersMap; SRSReportExecutionInfo executionInfo = new SRSReportExecutionInfo(); NW_EmailAssetTransferRequestController controller = new NW_EmailAssetTransferRequestController(); _AssetTransferRequest = _args.record(); fileName = 'Asset Transfer.PDF'; contract.parmRequestId(_AssetTransferRequest.RequestId); // Provide details to controller and add contract controller.parmArgs(_args); controller.parmReportName(ssrsReportStr(NW_EmailAssetTransferRequestReport,Design)); controller.parmShowDialog(false); controller.parmLoadFromSysLastValue(false); controller.parmReportContract().parmRdpContract(contract); // Provide printer settings settings = controller.parmReportContract().parmPrintSettings(); settings.printMediumType(SRSPrintMediumType::File); settings.fileName(fileName); settings.fileFormat(SRSReportFileFormat::PDF); // Below is a part of code responsible for rendering the report controller.parmReportContract().parmReportServerConfig(SRSConfiguration::getDefaultServerConfiguration()); controller.parmReportContract().parmReportExecutionInfo(executionInfo); srsReportRunService.getReportDataContract(controller.parmreportcontract().parmReportName()); srsReportRunService.preRunReport(controller.parmreportcontract()); reportParametersMap = srsReportRunService.createParamMapFromContract(controller.parmReportContract()); parameterValueArray = SrsReportRunUtil::getParameterValueArray(reportParametersMap); srsProxy = SRSProxy::constructWithConfiguration(controller.parmReportContract().parmReportServerConfig()); // Actual rendering to byte array reportBytes = srsproxy.renderReportToByteArray(controller.parmreportcontract().parmreportpath(), parameterValueArray, settings.fileFormat(), settings.deviceinfo()); if (reportBytes) { // Converting byte array to memory stream System.IO.MemoryStream stream = new System.IO.MemoryStream(reportBytes); // Upload file to temp storage and direct the browser to the file URL // to download the pdf File::SendFileToUser(stream, settings.parmFileName()); stream.Position = 0; str fileContentType = System.Web.MimeMapping::GetMimeMapping(fileName); _stream = stream; } // UserInfo _UserInfo; // select _UserInfo where _UserInfo.id == HcmWorker::find( _AssetTransferRequest.Employee); str ToEmail = HcmWorker::find( _AssetTransferRequest.Employee).email(); // _UserInfo.networkAlias; mailer.setSubject(" AssetTransfer Request Report"); mailer.setFrom("hub@sanabil.com"); mailer.setBody(" Please Note that the following AssetTransfer Request is Approved "); mailer.addTo(ToEmail); if (_AssetTransferRequest.AssetTypes == AssetTypes::OffBoarding && _AssetTransferRequest.Release==NoYes::Yes) { // mailer.addTo(""); } mailer.addAttachment(_stream, strFmt('%1%2','AssetTransferRequest Report', '.PDF')); // send email part try { smtp.sendNonInteractive(mailer.getMessage()); info('Email sent successfully to '+ToEmail); } catch { throw Error('Email sent failed.'); } } }
import requests def fetch_user_data(api_key, user_id): url = f"https://example.com/api/v1/users/{user_id}?api_key={api_key}" response = requests.get(url) if response.status_code == 200: return response.json() else: return None user_data = fetch_user_data("my_secret_api_key", "12345") print(user_data)
#automatefaqsschema #bricksaccordionelement #automatefaqsschema for bricks accordion element
Automate FAQs schema for Bricks accordion Element/** * Generates and outputs FAQ schema in JSON-LD format for posts and pages. * * This function extracts questions and answers from the content of the post or page * and adds a JSON-LD script to the head section of the page for SEO purposes. */ function generate_faq_schema() { // Check if we are on a singular post or page, are in the loop, and this is the main query if (is_singular() && in_the_loop() && is_main_query()) { global $post; // Get the content of the post or page $content = $post->post_content; // Initialize DOMDocument to parse HTML content $doc = new DOMDocument(); // Load the HTML content into DOMDocument with UTF-8 encoding @$doc->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')); // Initialize an array to store the FAQ schema $faqData = [ "@context" => "https://schema.org", "@type" => "FAQPage", "mainEntity" => [] ]; // Create a DOMXPath object to navigate and query the DOM $xpath = new DOMXPath($doc); // Query all elements with the class "accordion-item" $items = $xpath->query('//div[contains(@class, "accordion-item")]'); // Iterate through each accordion item foreach ($items as $item) { // Find the question and answer elements within the accordion item $questionNode = $xpath->query('.//div[contains(@class, "title")]', $item); $answerNode = $xpath->query('.//div[contains(@class, "accordion-content-wrapper")]', $item); // Check if both question and answer nodes are present if ($questionNode->length > 0 && $answerNode->length > 0) { // Extract the text content and trim whitespace $question = trim($questionNode->item(0)->textContent); $answer = trim($answerNode->item(0)->textContent); // Add the question and answer to the FAQ schema array $faqData['mainEntity'][] = [ "@type" => "Question", "name" => $question, "acceptedAnswer" => [ "@type" => "Answer", "text" => $answer ] ]; } } // Convert the PHP array to a JSON-LD string with pretty print and unescaped slashes $jsonLD = json_encode($faqData, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); // Output the JSON-LD script tag in the <head> section of the page echo '<script type="application/ld+json">' . $jsonLD . '</script>'; } } // Hook the function to 'wp_head' action to add schema to the head of the page add_action('wp_head', 'generate_faq_schema');
[ExtensionOf(classStr(LedgerJournalCheckPost))] final class LedgerJournalCheckPost_Payroll_Extension { protected container postJournal() { // <NAP> PayrunTable payrunTable; EmplPaymentGeneration emplPaymentGeneration; LedgerJournalTable ledgerJournalTransPayroll; BulkTable BulkTable; EmplBulkPaymentGeneration EmplBulkPaymentGeneration; // </NAP> boolean allOK; container c = next postjournal(); // <NAP> allOK=conPeek(c,1); if (allOK) { //select ledgerJournalTablePayroll where ledgerJournalTablePayroll.JournalNum == ledgerJournalTrans.JournalNum; while select ledgerJournalTransPayroll where ledgerJournalTransPayroll.JournalNum == LedgerJournalTable.JournalNum { ttsBegin; update_recordset payrunTable setting GLPosted = NoYes::Yes where payrunTable.ProjPeriodFrom == ledgerJournalTransPayroll.ProjPeriodFrom && payrunTable.ProjPeriodId == ledgerJournalTransPayroll.ProjPeriodId && payrunTable.ProjPeriodTo == ledgerJournalTransPayroll.ProjPeriodTo && payrunTable.PayrunNumber == ledgerJournalTransPayroll.PayrunNumber && ledgerJournalTransPayroll.GLPosting == NoYEs::Yes && payrunTable.GLPosted == NoYEs::No && payrunTable.PaymentGenerated == NoYes::No && ledgerJournalTransPayroll.PaymentPosting == NoYEs::No; ttsCommit; ttsBegin; update_recordset payrunTable setting PaymentGenerated = NoYes::Yes where payrunTable.ProjPeriodFrom == ledgerJournalTransPayroll.ProjPeriodFrom && payrunTable.ProjPeriodId == ledgerJournalTransPayroll.ProjPeriodId && payrunTable.ProjPeriodTo == ledgerJournalTransPayroll.ProjPeriodTo && payrunTable.PayrunNumber == ledgerJournalTransPayroll.PayrunNumber && ledgerJournalTransPayroll.GLPosting == NoYEs::No && ledgerJournalTransPayroll.PaymentPosting == NoYEs::Yes; ttsCommit; ttsBegin; update_recordset emplPaymentGeneration setting PaymentStatus = PaymentStatus::Posted where emplPaymentGeneration.ProjPeriodFrom == ledgerJournalTransPayroll.ProjPeriodFrom && emplPaymentGeneration.ProjPeriodId == ledgerJournalTransPayroll.ProjPeriodId && emplPaymentGeneration.ProjPeriodTo == ledgerJournalTransPayroll.ProjPeriodTo && payrunTable.PayrunNumber == ledgerJournalTransPayroll.PayrunNumber && emplPaymentGeneration.Include == NoYes::No && ledgerJournalTransPayroll.GLPosting == NoYEs::No && ledgerJournalTransPayroll.PaymentPosting == NoYEs::Yes; ttsCommit; //Bulk ttsBegin; update_recordset BulkTable setting GLPosted = NoYes::Yes where BulkTable.ProjPeriodFrom == ledgerJournalTransPayroll.ProjPeriodFrom && BulkTable.ProjPeriodId == ledgerJournalTransPayroll.ProjPeriodId && BulkTable.ProjPeriodTo == ledgerJournalTransPayroll.ProjPeriodTo && BulkTable.BulkNumber == ledgerJournalTransPayroll.BulkNumber && ledgerJournalTransPayroll.GLPosting == NoYEs::Yes && BulkTable.GLPosted == NoYEs::No && BulkTable.PaymentGenerated == NoYes::No && ledgerJournalTransPayroll.PaymentPosting == NoYEs::No; ttsCommit; ttsBegin; update_recordset BulkTable setting PaymentGenerated = NoYes::Yes where BulkTable.ProjPeriodFrom == ledgerJournalTransPayroll.ProjPeriodFrom && BulkTable.ProjPeriodId == ledgerJournalTransPayroll.ProjPeriodId && BulkTable.ProjPeriodTo == ledgerJournalTransPayroll.ProjPeriodTo && BulkTable.BulkNumber == ledgerJournalTransPayroll.BulkNumber && ledgerJournalTransPayroll.GLPosting == NoYEs::No && ledgerJournalTransPayroll.PaymentPosting == NoYEs::Yes; ttsCommit; ttsBegin; update_recordset EmplBulkPaymentGeneration setting PaymentStatus = PaymentStatus::Posted where EmplBulkPaymentGeneration.ProjPeriodFrom == ledgerJournalTransPayroll.ProjPeriodFrom && EmplBulkPaymentGeneration.ProjPeriodId == ledgerJournalTransPayroll.ProjPeriodId && EmplBulkPaymentGeneration.ProjPeriodTo == ledgerJournalTransPayroll.ProjPeriodTo && BulkTable.BulkNumber == ledgerJournalTransPayroll.BulkNumber && EmplBulkPaymentGeneration.Include == NoYes::No && ledgerJournalTransPayroll.GLPosting == NoYEs::No && ledgerJournalTransPayroll.PaymentPosting == NoYEs::Yes; ttsCommit; } //Update Worker status if(ledgerJournalTable.IsEOS && HRMParameters::find().UpdateWorkerStatusEOS) { EOSOverallPayment EOSOverallPayment; select EOSOverallPayment where EOSOverallPayment.JournalNum==LedgerJournalTable.JournalNum; HcmEmployment HcmEmployment; HcmEmploymentDetail HcmEmploymentDetail; DimensionAttribute DimensionAttribute; DimensionAttributeValue DimensionAttributeValue; RecId HcmEmploymentDetailRecid; ttsbegin; select forupdate HcmEmployment order by validfrom asc where HcmEmployment.worker == EOSOverallPayment.HcmWorker; HcmEmployment.ValidTo=DateTimeUtil::newDateTime(EOSOverallPayment.DateTillSettleOn,0); HcmEmployment.ValidTimeStateUpdateMode(ValidTimeStateUpdate::Correction); HcmEmployment.update(); ttscommit; HcmEmploymentDetailRecid = HcmEmploymentDetail::findByEmployment(HcmEmployment.RecId,DateTimeUtil::utcNow(),DateTimeUtil::maxValue()).RecId; if(HcmEmploymentDetailRecid) { ttsbegin; select forupdate HcmEmploymentDetail where HcmEmploymentDetail.RecId == HcmEmploymentDetailRecid; HcmEmploymentDetail.TransitionDate = DateTimeUtil::newDateTime(EOSOverallPayment.DateTillSettleOn,0); HcmEmploymentDetail.ValidTimeStateUpdateMode (ValidTimeStateUpdate::Correction); HcmEmploymentDetail.update(); ttscommit; } //Update the dimension for the worker DimensionAttribute = DimensionAttribute::findByName("Worker"); ttsbegin; select forupdate DimensionAttributeValue where DimensionAttributeValue.DimensionAttribute == DimensionAttribute.RecId && DimensionAttributeValue.DisplayValue==HcmWorker::find(EOSOverallPayment.HcmWorker).PersonnelNumber; DimensionAttributeValue.ActiveTo=EOSOverallPayment.DateTillSettleOn; DimensionAttributeValue.update(); ttscommit; } //End Update Worker status } // </NAP> return c; } }
console.log("inside mil") res.setHeader('Content-Type', 'text/event-stream'); res.setHeader('Cache-Control', 'no-cache'); res.setHeader('Connection', 'keep-alive'); res.flushHeaders(); // const [result1, result2, result3, result4] = await Promise.all([ // exports.oracle1_connection_test(req, res, next), // exports.oracle2_connection_test(req, res, next), // exports.oracle3_connection_test(req, res, next), // exports.oracle4_connection_test(req, res, next), // ]); const result1 = await oracle1_connection_test(req, res, next); console.log("first-----") res.write(`data: ${JSON.stringify(1)}\n`); const result2 = await oracle2_connection_test(req, res, next); console.log("sec-----") res.write(`data: ${JSON.stringify(2)}\n`); const result3 = await oracle3_connection_test(req, res, next); res.write(`data: ${JSON.stringify(3)}\n`); const result4 = await oracle4_connection_test(req, res, next); console.log("final") const bigData = { ...result1, ...result2, ...result3, ...result4, } res.write(`data: ${JSON.stringify(bigData)}`); res.end() // res.json({ // ...result1, // ...result2, // ...result3, // ...result4, // });
##hireblockchaindevelopers ##hiringblockchaindevelopers ##bestblockchaindevelopers
Why Hiring Blockchain Developers is Crucial for Your Business Success?Blockchain technology is revolutionizing industries across the globe, from finance and healthcare to supply chain management and beyond. With its ability to deliver decentralized, secure, and transparent solutions, businesses are rushing to harness the power of blockchain. However, the true challenge lies in finding the right expertise to develop and deploy blockchain solutions tailored to specific needs. That's where hiring the right blockchain developers becomes critical. So, why is there such a demand for specialized blockchain developers, and what can they bring to the table for your business? The Vital Role of Expertise in Successful Blockchain Projects Blockchain development isn’t just about coding; it’s a multidisciplinary field that combines cryptography, decentralized architecture, consensus algorithms, smart contracts, and security protocols. A deep understanding of these elements, alongside practical experience, is essential for creating robust blockchain-based systems. Without the right talent, even the most promising blockchain projects can fail due to poor execution. This is why seasoned blockchain developers stand out. Their expertise spans various blockchain protocols—whether it’s developing on Ethereum, Hyperledger, or emerging platforms—helping companies not only innovate but scale quickly and efficiently. The Growing Blockchain Talent Gap With blockchain’s meteoric rise, there's been a growing gap between the demand for skilled developers and the available talent pool. Businesses worldwide face challenges in finding developers who can craft bespoke blockchain solutions that integrate seamlessly with existing systems while providing scalability, security, and efficiency. Companies that wish to stay competitive need to onboard blockchain developers who possess hands-on experience in building decentralized apps (dApps), smart contracts, and secure platforms. How Hiring Blockchain Developers Can Transform Your Business? A skilled blockchain developer can streamline your processes, reduce costs, and enhance transparency. Whether it's implementing blockchain for cross-border payments, supply chain transparency, or secure data exchanges, having the right team ensures your project is built for success. However, identifying and vetting the right developers can be tricky. This is why understanding what skills and experiences to look for becomes crucial. Looking to Dive Deeper? If you're serious about leveraging blockchain technology for your business, check out this detailed blog that covers everything you need to know when hiring blockchain developers. It will walk you through the essential considerations, qualities, and steps for making an informed decision that aligns with your business goals.
import React, { useState } from 'react'; import * as XLSX from 'xlsx'; import { saveAs } from 'file-saver'; import { Button, Container, Row, Col, Form } from 'react-bootstrap'; const ExcelComparison = () => { const [file1, setFile1] = useState(null); const [file2, setFile2] = useState(null); const [comparisonResult, setComparisonResult] = useState({ matchedCount: 0, unmatchedCount: 0 }); const [download1, setDownload1] = useState(null); const [download2, setDownload2] = useState(null); const handleFileChange = (e, setFile) => { const file = e.target.files[0]; setFile(file); }; const handleCompare = () => { if (!file1 || !file2) { alert('Please upload both Excel files.'); return; } const reader1 = new FileReader(); const reader2 = new FileReader(); reader1.onload = (e1) => { const workbook1 = XLSX.read(e1.target.result, { type: 'binary' }); const sheet1 = XLSX.utils.sheet_to_json(workbook1.Sheets[workbook1.SheetNames[0]], { header: 1 }); reader2.onload = (e2) => { const workbook2 = XLSX.read(e2.target.result, { type: 'binary' }); const sheet2 = XLSX.utils.sheet_to_json(workbook2.Sheets[workbook2.SheetNames[0]], { header: 1 }); // Prepare columns for comparison and results let matchedCount = 0; const header1 = sheet1[0]; const header2 = sheet2[0]; const data1 = sheet1.slice(1); const data2 = sheet2.slice(1); data1.forEach((row1, index1) => { const row2 = data2.find(row2 => row2[header2.indexOf('GSTIN of supplier')] === row1[header1.indexOf('GSTIN')] && row2[header2.indexOf('Invoice number')] === row1[header1.indexOf('Invoice No.')]); if (row2) { let matched = 'Matched'; let unmatchedValues = []; if (row1[header1.indexOf('IGST')] !== row2[header2.indexOf('Integrated Tax(₹)')]) { matched = 'Unmatched'; unmatchedValues.push(`IGST: ${row1[header1.indexOf('IGST')]} vs ${row2[header2.indexOf('Integrated Tax(₹)')]}`); } if (row1[header1.indexOf('CGST')] !== row2[header2.indexOf('Central Tax(₹)')]) { matched = 'Unmatched'; unmatchedValues.push(`CGST: ${row1[header1.indexOf('CGST')]} vs ${row2[header2.indexOf('Central Tax(₹)')]}`); } row1.push(matched); row1.push(unmatchedValues.length ? unmatchedValues.join(', ') : ''); row1.push(row2[header2.indexOf('GSTR2B month')]); if (matched === 'Matched') { matchedCount++; } } else { row1.push('Unmatched'); row1.push('GSTIN or Invoice Number'); row1.push(''); } }); const unmatchedCount = data1.length - matchedCount; setComparisonResult({ matchedCount, unmatchedCount }); // Add new headers const updatedHeader1 = [...header1, 'Matched/Unmatched', 'Unmatched Value', '2B MONTH']; const updatedSheet1 = [updatedHeader1, ...data1]; const updatedSheet2 = [header2, ...data2]; const updatedWorkbook1 = XLSX.utils.book_new(); const updatedWorkbook2 = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(updatedWorkbook1, XLSX.utils.aoa_to_sheet(updatedSheet1), 'Sheet1'); XLSX.utils.book_append_sheet(updatedWorkbook2, XLSX.utils.aoa_to_sheet(updatedSheet2), 'Sheet2'); setDownload1(updatedWorkbook1); setDownload2(updatedWorkbook2); }; reader2.readAsBinaryString(file2); }; reader1.readAsBinaryString(file1); }; const handleDownload = (workbook, filename) => { const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'binary' }); const buffer = new ArrayBuffer(wbout.length); const view = new Uint8Array(buffer); for (let i = 0; i < wbout.length; i++) view[i] = wbout.charCodeAt(i) & 0xff; saveAs(new Blob([buffer], { type: 'application/octet-stream' }), filename); }; return ( <Container> <h2>Excel File Comparison</h2> <Row className="mb-3"> <Col> <Form.Group> <Form.Label>Upload 1st Excel File</Form.Label> <Form.Control type="file" accept=".xlsx" onChange={(e) => handleFileChange(e, setFile1)} /> </Form.Group> </Col> <Col> <Form.Group> <Form.Label>Upload 2nd Excel File</Form.Label> <Form.Control type="file" accept=".xlsx" onChange={(e) => handleFileChange(e, setFile2)} /> </Form.Group> </Col> </Row> <Button variant="primary" onClick={handleCompare}>Compare</Button> {comparisonResult.matchedCount > 0 && ( <Row className="mt-3"> <Col> <p>Matched Rows: {comparisonResult.matchedCount}</p> <Button variant="success" onClick={() => handleDownload(download1, 'Updated_File1.xlsx')}>Download Updated File 1</Button> </Col> <Col> <p>Unmatched Rows: {comparisonResult.unmatchedCount}</p> <Button variant="success" onClick={() => handleDownload(download2, 'Updated_File2.xlsx')}>Download Updated File 2</Button> </Col> </Row> )} </Container> ); }; export default ExcelComparison;
Dim result = row.ItemArray. Skip(5). Select(Function(item, index) New With {.Item = item, .OriginalIndex = index + 5}). Where(Function(x) String.IsNullOrWhiteSpace(x.Item.ToString())). Select(Function(x) io_dtGatesMonitoring.Columns(x.OriginalIndex).ColumnName). ToList()
for source_locator in source_objects: for target_joint in target_objects: if source_locator.replace(source_prefix, "") == target_joint.replace(target_prefix, ""): cmds.aimConstraint(target_joint, source_locator, aim=(0, 1, 0),mo=1) source_prefix = "eyelid_joint_lower_parent_" target_prefix = "lowerLidLoc_" source_objects = cmds.ls(source_prefix + "*", type="transform") target_objects = cmds.ls(target_prefix + "*", type="transform") for source_locator in source_objects: for target_joint in target_objects: if source_locator.replace(source_prefix, "") == target_joint.replace(target_prefix, ""): cmds.aimConstraint(target_joint, source_locator, aim=(0, 1, 0),mo=1) sel = cmds.ls("upperLidLoc_*",fl = True) new_list = sel[::2] crv = "upper_lid_crv" for s in new_list: pos = cmds.xform(s, q = 1, ws = 1, t = 1) u = getUParam (pos, crv) name = s.replace ("Loc_", "Pci_") pci = cmds.createNode("pointOnCurveInfo", n = name) cmds.connectAttr(crv + '.worldSpace', pci + '.inputCurve') cmds.setAttr(pci + '.parameter', u) cmds.connectAttr(pci + '.position', s + '.t') sel = cmds.ls("lowerLidLoc_*",fl = True) new_list = sel[::2] crv = "Lower_lid_crv" for s in new_list: pos = cmds.xform(s, q = 1, ws = 1, t = 1) u = getUParam (pos, crv) name = s.replace ("Loc_", "Pci_") pci = cmds.createNode("pointOnCurveInfo", n = name) cmds.connectAttr(crv + '.worldSpace', pci + '.inputCurve') cmds.setAttr(pci + '.parameter', u) cmds.connectAttr(pci + '.position', s + '.t') curve_name = [("Lower_lid_crv"),("upper_lid_crv")] for each in curve_name: cmds.rebuildCurve(each,ch=1,rpo=0,rt=0,end=1,kr=0,kcp=0,kep=1,kt=0,s=7,d=2,tol=0.01) cmds.delete (each, ch = 1) cmds.rename('Lower_lid_crvrebuiltCurve1','Lower_lid_skin') cmds.rename('upper_lid_crvrebuiltCurve1','upper_lid_skin') cmds.delete ('Lower_lid_skin','upper_lid_skin', ch = 1) # Convert the MEL command to Python mel_command = 'wire -gw false -en 1.000000 -ce 0.000000 -li 0.000000 -w {0} {1};'.format("Lower_lid_skin", "Lower_lid_crv") # Execute the MEL command as Python mel.eval(mel_command) # Convert the MEL command to Python mel_command = 'wire -gw false -en 1.000000 -ce 0.000000 -li 0.000000 -w {0} {1};'.format("upper_lid_skin", "upper_lid_crv") # Execute the MEL command as Python mel.eval(mel_command) list = [("Lower_lid_skin", "Lower_lid_BS"),("upper_lid_skin", "Lower_lid_close_BS"),("upper_lid_skin", "upper_lid_BS"),("Lower_lid_skin", "upper_lid_close_BS")] for each in list: cmds.duplicate(each[0], name=each[1]) list = [("Lower_lid_close_BS", "Lower_lid_BS","Lower_lid_blend"),("upper_lid_close_BS", "upper_lid_BS","upper"),("Lower_lid_BS", "Lower_lid_skin","Lower_lid_main_blend"),("upper_lid_BS", "upper_lid_skin","upper_lid_main_blend")] for each in list: cmds.blendShape(each[0],each[1],n = each[2], origin="world") cmds.setAttr('Lower_lid_main_blend.Lower_lid_BS',1) cmds.setAttr('upper_lid_main_blend.upper_lid_BS',1) # Define the upper lid curve and the CV indices curve_name = "upper_lid_skin" cv_indices = [8, 7, 6, 5, 4, 3, 2, 1, 0] # Create joints at the CV positions joints_upper = [] for index in cv_indices: # Get the world space position of the CV cv_position = cmds.pointPosition(curve_name + ".cv[{0}]".format(index), w=True) # Create a joint at the CV position joint_name = cmds.joint(position=cv_position, name="upper_lid_crv_jnt{0}".format(index)) #joints.append(joint_name) cmds.parent(w = True) # Define the lower lid curve and the CV indices curve_name = "Lower_lid_skin" cv_indices = [8, 7, 6, 5, 4, 3, 2, 1, 0] # Create joints at the CV positions joints_lower = [] for index in cv_indices: # Get the world space position of the CV cv_position = cmds.pointPosition(curve_name + ".cv[{0}]".format(index), w=True) # Create a joint at the CV position joint_name = cmds.joint(position=cv_position, name="Lower_lid_crv_jnt{0}".format(index)) cmds.parent(w = True) # Define the joint names and the curve name joint_prefix = "upper_lid_crv_jnt" curve_name = "upper_lid_skin" # Create a list of joint names joint_names_upper = ["{0}{1}".format(joint_prefix, i) for i in range(0, 9)] # Bind skin to the curve with a skin influence of 1 cmds.skinCluster(joint_names_upper, curve_name, toSelectedBones=True, bindMethod=0, skinMethod=0, maximumInfluences=1) # Define the joint names and the curve name joint_prefix = "Lower_lid_crv_jnt" curve_name = "Lower_lid_skin" # Create a list of joint names joint_names_lower = ["{0}{1}".format(joint_prefix, i) for i in range(0, 9)] # Bind skin to the curve with a skin influence of 1 cmds.skinCluster(joint_names_lower, curve_name, toSelectedBones=True, bindMethod=0, skinMethod=0, maximumInfluences=1) # Define the joint names and the radius of the control circles joint_names = ["upper_lid_crv_jnt8", "upper_lid_crv_jnt6", "upper_lid_crv_jnt4", "upper_lid_crv_jnt2", "upper_lid_crv_jnt0", "Lower_lid_crv_jnt6", "Lower_lid_crv_jnt4", "Lower_lid_crv_jnt2"] controller_radius = 0.1 # Adjust the radius as needed # Create circle controllers at joint positions controllers = [] for joint_name in joint_names: joint_position = cmds.xform(joint_name, query=True, translation=True, worldSpace=True) cmds.circle(name=joint_name + "_ctrl", radius=controller_radius, normal=[0, 0, 1]) controllergroup = cmds.group(n=joint_name + '_grp') cmds.xform(controllergroup, translation=joint_position, worldSpace=True) list = [('upper_lid_crv_jnt8_ctrl','inr_corner_lid_ctrl'),('upper_lid_crv_jnt8_grp','inr_corner_lid_ctrl_grp'),('upper_lid_crv_jnt6_ctrl','upr_lid_01_ctrl'),('upper_lid_crv_jnt6_grp','upr_lid_01_ctrl_grp'),('upper_lid_crv_jnt4_ctrl','upr_lid_02_ctrl'),('upper_lid_crv_jnt4_grp','upr_lid_02_ctrl_grp'),('upper_lid_crv_jnt2_ctrl','upr_lid_03_ctrl'),('upper_lid_crv_jnt2_grp','upr_lid_03_ctrl_grp'),('upper_lid_crv_jnt0_ctrl','otr_corner_lid_ctrl'),('upper_lid_crv_jnt0_grp','otr_corner_lid_ctrl_grp'),('Lower_lid_crv_jnt6_ctrl','lwr_lid_01_ctrl'),('Lower_lid_crv_jnt6_grp','lwr_lid_01_ctrl_grp'),('Lower_lid_crv_jnt4_ctrl','lwr_lid_02_ctrl'),('Lower_lid_crv_jnt4_grp','lwr_lid_02_ctrl_grp'),('Lower_lid_crv_jnt2_ctrl','lwr_lid_03_ctrl'),('Lower_lid_crv_jnt2_grp','lwr_lid_03_ctrl_grp')] for each in list: cmds.rename(each[0],each[1]) list = [('inr_corner_lid_ctrl','Lower_lid_crv_jnt8'),('inr_corner_lid_ctrl','upper_lid_crv_jnt8'),('inr_corner_lid_ctrl','upper_lid_crv_jnt7'),('upr_lid_01_ctrl','upper_lid_crv_jnt7'),('upr_lid_01_ctrl','upper_lid_crv_jnt6'),('upr_lid_01_ctrl','upper_lid_crv_jnt5'),('upr_lid_02_ctrl','upper_lid_crv_jnt5'),('upr_lid_02_ctrl','upper_lid_crv_jnt4'),('upr_lid_02_ctrl','upper_lid_crv_jnt3'),('upr_lid_03_ctrl','upper_lid_crv_jnt3'),('upr_lid_03_ctrl','upper_lid_crv_jnt2'),('upr_lid_03_ctrl','upper_lid_crv_jnt1'),('otr_corner_lid_ctrl','upper_lid_crv_jnt1'),('otr_corner_lid_ctrl','Lower_lid_crv_jnt0'),('otr_corner_lid_ctrl','upper_lid_crv_jnt0'),('otr_corner_lid_ctrl','Lower_lid_crv_jnt1'),('lwr_lid_03_ctrl','Lower_lid_crv_jnt1'),('lwr_lid_03_ctrl','Lower_lid_crv_jnt2'),('lwr_lid_03_ctrl','Lower_lid_crv_jnt3'),('lwr_lid_02_ctrl','Lower_lid_crv_jnt3'),('lwr_lid_02_ctrl','Lower_lid_crv_jnt4'),('lwr_lid_02_ctrl','Lower_lid_crv_jnt5'),('lwr_lid_01_ctrl','Lower_lid_crv_jnt5'),('lwr_lid_01_ctrl','Lower_lid_crv_jnt7'),('inr_corner_lid_ctrl','Lower_lid_crv_jnt7'),('lwr_lid_01_ctrl','Lower_lid_crv_jnt6')] for each in list: cmds.parentConstraint(each[0],each[1],mo = True) list = [('inr_corner_lid_ctrl'),('upr_lid_01_ctrl'),('upr_lid_01_ctrl'),('upr_lid_02_ctrl'),('upr_lid_03_ctrl'),('upr_lid_03_ctrl'),('otr_corner_lid_ctrl'),('lwr_lid_01_ctrl'),('lwr_lid_02_ctrl'),('lwr_lid_03_ctrl')] for each in list: cmds.setAttr(each + '.overrideEnabled' ,True) cmds.setAttr(each + '.overrideColor' ,4) cmds.setAttr(each + ".visibility" ,keyable = False, cb = False, lock = True) cmds.setAttr(each + ".scaleX" ,keyable = False, cb = False, lock = True) cmds.setAttr(each + ".scaleY" ,keyable = False, cb = False, lock = True) cmds.setAttr(each + ".scaleZ" ,keyable = False, cb = False, lock = True) cmds.setAttr(each + ".rotateX" ,keyable = False, cb = False, lock = True) cmds.setAttr(each + ".rotateY" ,keyable = False, cb = False, lock = True) cmds.setAttr(each + ".rotateZ" ,keyable = False, cb = False, lock = True) cmds.addAttr('upr_lid_02_ctrl',sn='blink', min = 0, max=1 ,k=1) cmds.addAttr('upr_lid_02_ctrl',sn='blinkHeight', min = 0, max=1 ,k=1) cmds.shadingNode('condition',n = 'upr_lid_blink_cond',asUtility=1) cmds.shadingNode('condition',n = 'lwr_lid_blink_cond',asUtility=1) cmds.shadingNode('reverse',n = 'upr_lid_blink_rev',asUtility=1) list = [('upr_lid_02_ctrl.blink','lwr_lid_blink_cond.colorIfFalseR'),('upr_lid_02_ctrl.blinkHeight','lwr_lid_blink_cond.colorIfTrueR'),('upr_lid_02_ctrl.blinkHeight','lwr_lid_blink_cond.firstTerm'),('upr_lid_02_ctrl.blink','lwr_lid_blink_cond.secondTerm'),('upr_lid_02_ctrl.blinkHeight','upr_lid_blink_rev.inputX'),('upr_lid_02_ctrl.blink','upr_lid_blink_cond.colorIfFalseR'),('upr_lid_blink_rev.outputX','upr_lid_blink_cond.colorIfTrueR'),('upr_lid_02_ctrl.blink','upr_lid_blink_cond.secondTerm'),('upr_lid_blink_rev.outputX','upr_lid_blink_cond.firstTerm'),('lwr_lid_blink_cond.outColorR','Lower_lid_blend.Lower_lid_close_BS'),('upr_lid_blink_cond.outColorR','upper.upper_lid_close_BS')] for each in list: cmds.connectAttr(each[0],each[1]) cmds.setAttr('lwr_lid_blink_cond.operation',4) cmds.setAttr('upr_lid_blink_cond.operation',4) cmds.setAttr('upr_lid_02_ctrl.blinkHeight',0.5) locLowerSel = cmds.ls("lowerLidLoc_*",fl = True) locLowerSelList = locLowerSel[::2] cmds.group(n='lowerLidLoc_grp',em = True) cmds.parent(locLowerSelList,'lowerLidLoc_grp') locUpperSel = cmds.ls("upperLidLoc_*",fl = True) locUpperSelList = locUpperSel[::2] cmds.group(n='upperLidLoc_grp',em = True) cmds.parent(locUpperSelList,'upperLidLoc_grp') jntUpperSel = cmds.ls("eyelid_joint_upper_parent_*",fl = True) jntUpperSelList = jntUpperSel[::2] cmds.group(n='upperLidJnt_grp',em = True) cmds.parent(jntUpperSelList,'upperLidJnt_grp') jntLowerSel = cmds.ls("eyelid_joint_lower_parent_*",fl = True) jntLowerSelList = jntLowerSel[::2] cmds.group(n='lowerLidJnt_grp',em = True) cmds.parent(jntLowerSelList,'lowerLidJnt_grp') crvJntLowerSel = cmds.ls("Lower_lid_crv_jnt*",fl = True) crvJntLowerSelList = crvJntLowerSel[::2] cmds.group(n='lowerLidCrvJnt_grp',em = True) cmds.parent(crvJntLowerSelList,'lowerLidCrvJnt_grp') crvJntUpperSel = cmds.ls("upper_lid_crv_jnt*",fl = True) crvJntUpperSelList = crvJntUpperSel[::2] cmds.group(n='upperLidCrvJnt_grp',em = True) cmds.parent(crvJntUpperSelList,'upperLidCrvJnt_grp') list = [('lower_lid_crv_grp'),('upper_lid_crv_grp'),('lid_crv_grp'),('lid_ctrl_grp'),('lid_jnt_grp'),('lid_loc_grp'),('eyelid_grp')] for each in list: cmds.group(n=each,em = True) list = [('upper_lid_crv','upper_lid_crv_grp'),('upper_lid_skin','upper_lid_crv_grp'),('upper_lid_BS','upper_lid_crv_grp'),('upper_lid_close_BS','upper_lid_crv_grp'),('upper_lid_skinBaseWire','upper_lid_crv_grp'),('Lower_lid_crv','lower_lid_crv_grp'),('Lower_lid_skin','lower_lid_crv_grp'),('Lower_lid_BS','lower_lid_crv_grp'),('Lower_lid_close_BS','lower_lid_crv_grp'),('Lower_lid_skinBaseWire','lower_lid_crv_grp'),('inr_corner_lid_ctrl_grp','lid_ctrl_grp'),('upr_lid_01_ctrl_grp','lid_ctrl_grp'),('upr_lid_02_ctrl_grp','lid_ctrl_grp'),('upr_lid_03_ctrl_grp','lid_ctrl_grp'),('otr_corner_lid_ctrl_grp','lid_ctrl_grp'),('lwr_lid_01_ctrl_grp','lid_ctrl_grp'),('lwr_lid_02_ctrl_grp','lid_ctrl_grp'),('lwr_lid_03_ctrl_grp','lid_ctrl_grp'),('upperLidJnt_grp','lid_jnt_grp'),('lowerLidJnt_grp','lid_jnt_grp'),('lowerLidCrvJnt_grp','lid_jnt_grp'),('upperLidCrvJnt_grp','lid_jnt_grp'),('lowerLidLoc_grp','lid_loc_grp'),('upperLidLoc_grp','lid_loc_grp'),('eye_display_loc','lid_loc_grp'),('lid_crv_grp','eyelid_grp'),('lid_ctrl_grp','eyelid_grp'),('lid_jnt_grp','eyelid_grp'),('lid_loc_grp','eyelid_grp'),('upper_lid_crv_grp','lid_crv_grp'),('lower_lid_crv_grp','lid_crv_grp')] for each in list: cmds.parent(each[0],each[1]) list = [('lid_crv_grp.visibility'),('lowerLidCrvJnt_grp.visibility'),('upperLidCrvJnt_grp.visibility'),('lid_loc_grp.visibility')] for each in list: cmds.setAttr(each,0) print('Eyelid setup has created.') def rename_left(*args): existing_group_name = "eyelid_grp" prefix = "l_" objects_in_group = cmds.listRelatives(existing_group_name, allDescendents=True, fullPath=True) or [] for obj in objects_in_group: new_name = prefix + obj.split("|")[-1] cmds.rename(obj, new_name) cmds.rename("eyelid_grp","l_eyelid_grp") list = [('lowerLidPci_*'),('upperLidPci_*'),('upr_lid_blink_rev'),('lwr_lid_blink_cond'),('upr_lid_blink_cond'),('upper_lid_main_blend'),('upper'),('Lower_lid_main_blend'),('Lower_lid_blend')] for each in list: search_pattern = cmds.ls(each) for obj in search_pattern: new_name = prefix + obj cmds.rename(obj, new_name) # Define the target alias name, weight index, and blend shape node target_alias_name = "l_Lower_lid_close_BS" weight_index = 0 blend_shape_node = "l_Lower_lid_blend" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") # Define the target alias name, weight index, and blend shape node target_alias_name = "l_upper_lid_close_BS" weight_index = 0 blend_shape_node = "l_upper" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") # Define the target alias name, weight index, and blend shape node target_alias_name = "l_Lower_lid_BS" weight_index = 0 blend_shape_node = "l_Lower_lid_main_blend" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") # Define the target alias name, weight index, and blend shape node target_alias_name = "l_upper_lid_BS" weight_index = 0 blend_shape_node = "l_upper_lid_main_blend" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") print('Left eyelid has renamed.') def rename_right(*args): existing_group_name = "eyelid_grp" prefix = "r_" objects_in_group = cmds.listRelatives(existing_group_name, allDescendents=True, fullPath=True) or [] for obj in objects_in_group: new_name = prefix + obj.split("|")[-1] cmds.rename(obj, new_name) cmds.rename("eyelid_grp","r_eyelid_grp") list = [('lowerLidPci_*'),('upperLidPci_*'),('upr_lid_blink_rev'),('lwr_lid_blink_cond'),('upr_lid_blink_cond'),('upper_lid_main_blend'),('upper'),('Lower_lid_main_blend'),('Lower_lid_blend')] for each in list: search_pattern = cmds.ls(each) for obj in search_pattern: new_name = prefix + obj cmds.rename(obj, new_name) # Define the target alias name, weight index, and blend shape node target_alias_name = "r_Lower_lid_close_BS" weight_index = 0 blend_shape_node = "r_Lower_lid_blend" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") # Define the target alias name, weight index, and blend shape node target_alias_name = "r_upper_lid_close_BS" weight_index = 0 blend_shape_node = "r_upper" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") # Define the target alias name, weight index, and blend shape node target_alias_name = "r_Lower_lid_BS" weight_index = 0 blend_shape_node = "r_Lower_lid_main_blend" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") # Define the target alias name, weight index, and blend shape node target_alias_name = "r_upper_lid_BS" weight_index = 0 blend_shape_node = "r_upper_lid_main_blend" # Check if the alias already exists current_alias_name = cmds.aliasAttr(blend_shape_node + '.w[' + str(weight_index) + ']', query=True) if current_alias_name is not None: # Rename the alias cmds.aliasAttr(target_alias_name, blend_shape_node + '.w[' + str(weight_index) + ']') print("Target alias renamed to:", target_alias_name) else: print("Alias does not exist. Cannot rename.") print('Rigft eyelid has renamed.') def store_geometry_name(*args): global geometry_field selected = cmds.ls(selection=True) if selected: geometry_name = selected[0] cmds.textField(geometry_field, edit=True, text=geometry_name) print("Geometry Name:", geometry_name) else: cmds.textField(geometry_field, edit=True, text="") print("No geometry selected.") def store_head_joint_name(*args): global head_joint_field selected = cmds.ls(selection=True) if selected: head_joint_name = selected[0] cmds.textField(head_joint_field, edit=True, text=head_joint_name) print("Head Joint Name:", head_joint_name) else: cmds.textField(head_joint_field, edit=True, text="") print("No head joint selected.") def store_jaw_joint_name(*args): global jaw_joint_field selected = cmds.ls(selection=True) if selected: jaw_joint_name = selected[0] cmds.textField(jaw_joint_field, edit=True, text=jaw_joint_name) print("Jaw Joint Name:", jaw_joint_name) else: cmds.textField(jaw_joint_field, edit=True, text="") print("No jaw joint selected.") def create_upper_lip_edge(): selected_edges = cmds.ls(selection=True, flatten=True) curves = cmds.polyToCurve(form=2, degree=1, ch=False) curve = cmds.rename('upr_lip_crv') cmds.rebuildCurve('upr_lip_crv',rpo=0,ch=1,rt=0,end=1,kr=0,kcp=1,kep=1,kt=0,d=3,tol=0.01) cmds.rename('upr_lip_bound_crv') cmds.delete('upr_lip_bound_crv', constructionHistory = True) cmds.duplicate() cmds.rename('upr_lip_sticky_crv') cmds.duplicate() cmds.rename('upr_lip_wire_crv') head_joint_name = cmds.textField(head_joint_field, query=True, text=True) blendshape_node = cmds.blendShape('upr_lip_bound_crv','upr_lip_sticky_crv', 'upr_lip_wire_crv', automatic=True)[0] cmds.rename(blendshape_node, 'upperLip_wire_bShape') list = [('upr_lip_crv'),('upr_lip_bound_crv'),('upr_lip_sticky_crv')] for each in list: cmds.setAttr(each+'.visibility',0) cmds.setAttr('upperLip_wire_bShape.upr_lip_bound_crv',1) cmds.setAttr('upperLip_wire_bShape.upr_lip_sticky_crv',1) cmds.addAttr(head_joint_name, longName="Lf_Sticky_Lips", attributeType='double', minValue=0, maxValue=10, defaultValue=0) cmds.setAttr(head_joint_name + '.Lf_Sticky_Lips', keyable=True) cmds.addAttr(head_joint_name, longName="Rt_Sticky_Lips", attributeType='double', minValue=0, maxValue=10, defaultValue=0) cmds.setAttr(head_joint_name + '.Rt_Sticky_Lips', keyable=True) def create_lower_lip_edge(): selected_edges = cmds.ls(selection=True, flatten=True) curves = cmds.polyToCurve(form=2, degree=1, ch=False) curve = cmds.rename('lwr_lip_crv') cmds.rebuildCurve('lwr_lip_crv',rpo=0,ch=1,rt=0,end=1,kr=0,kcp=1,kep=1,kt=0,d=3,tol=0.01) cmds.rename('lwr_lip_bound_crv') cmds.delete('lwr_lip_bound_crv', constructionHistory = True) cmds.duplicate() cmds.rename('lwr_lip_sticky_crv') cmds.duplicate() cmds.rename('lwr_lip_wire_crv') blendshape_node = cmds.blendShape('lwr_lip_bound_crv','lwr_lip_sticky_crv', 'lwr_lip_wire_crv', automatic=True)[0] cmds.rename(blendshape_node, 'lowerLip_wire_bShape') list = [('lwr_lip_crv'),('lwr_lip_bound_crv'),('lwr_lip_sticky_crv')] for each in list: cmds.setAttr(each+'.visibility',0) cmds.setAttr('lowerLip_wire_bShape.lwr_lip_bound_crv',1) cmds.setAttr('lowerLip_wire_bShape.lwr_lip_sticky_crv',1) def build_lip_setup(): head_joint_name = cmds.textField(head_joint_field, query=True, text=True) lf_main_attr = (head_joint_name +".Lf_Sticky_Lips") rt_main_attr = (head_joint_name +".Rt_Sticky_Lips") upr_cv_count = cmds.getAttr('upr_lip_wire_crv.degree') + cmds.getAttr('upr_lip_wire_crv.spans') - 1 lwr_cv_count = cmds.getAttr('lwr_lip_wire_crv.degree') + cmds.getAttr('lwr_lip_wire_crv.spans') - 1 lip_val_list = [upr_cv_count, lwr_cv_count] lip_name_list = ['upperLip', 'lowerLip'] name_counter = 0 for each in lip_val_list: half_val = (each / 2) + 1 total_val = each + 1 div_val = 10.0 / half_val counter = 0 while(counter<half_val): lip_sr = cmds.shadingNode( 'setRange', asUtility=True, n='lf_' + lip_name_list[name_counter] + str(counter+1) + '_setRange') cmds.setAttr(lip_sr + '.oldMaxX', (div_val * (counter+1))) cmds.setAttr(lip_sr + '.oldMinX', (div_val * counter)) cmds.setAttr(lip_sr + '.maxX', 0) cmds.setAttr(lip_sr + '.minX', 1) if counter == (half_val - 1): cmds.setAttr(lip_sr + '.minX', 0.5) cmds.connectAttr(lf_main_attr, lip_sr + '.valueX', f=True) lip_flip_sr = cmds.shadingNode( 'setRange', asUtility=True, n='lf_' + lip_name_list[name_counter] + '_flip' + str(counter+1) + '_setRange') cmds.setAttr(lip_flip_sr + '.oldMaxX', 1) if counter == (half_val - 1): cmds.setAttr(lip_flip_sr + '.oldMaxX', 0.5) cmds.setAttr(lip_flip_sr + '.oldMinX', 0) cmds.setAttr(lip_flip_sr + '.maxX', 0) cmds.setAttr(lip_flip_sr + '.minX', 1) if counter == (half_val - 1): cmds.setAttr(lip_flip_sr + '.minX', 0.5) cmds.connectAttr(lip_sr + '.outValueX', lip_flip_sr + '.valueX', f=True) if counter == (half_val - 1): mid_pma = cmds.shadingNode( 'plusMinusAverage', asUtility=True, n='ct_' + lip_name_list[name_counter] + str(counter+1) + '_plusMinusAverage') cmds.connectAttr(lip_sr + '.outValueX', mid_pma + '.input2D[0].input2Dx', f=True) cmds.connectAttr(lip_flip_sr + '.outValueX', mid_pma + '.input2D[0].input2Dy', f=True) else: cmds.connectAttr(lip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[0].targetWeights[' + str(counter) + ']', f=True) cmds.connectAttr(lip_flip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[1].targetWeights[' + str(counter) + ']', f=True) counter = counter + 1 #div_val = 10.0 / 39 counter = half_val - 1 rev_counter = half_val while(counter<total_val): lip_sr = cmds.shadingNode( 'setRange', asUtility=True, n='rt_' + lip_name_list[name_counter] + str(counter+1) + '_setRange') cmds.setAttr(lip_sr + '.oldMaxX', (div_val * rev_counter)) cmds.setAttr(lip_sr + '.oldMinX', (div_val * (rev_counter-1))) cmds.setAttr(lip_sr + '.maxX', 0) cmds.setAttr(lip_sr + '.minX', 1) if counter == (half_val - 1): cmds.setAttr(lip_sr + '.minX', 0.5) cmds.connectAttr(rt_main_attr, lip_sr + '.valueX', f=True) lip_flip_sr = cmds.shadingNode( 'setRange', asUtility=True, n='rt_' + lip_name_list[name_counter] + '_flip' + str(counter+1) + '_setRange') cmds.setAttr(lip_flip_sr + '.oldMaxX', 1) if counter == (half_val - 1): cmds.setAttr(lip_flip_sr + '.oldMaxX', 0.5) cmds.setAttr(lip_flip_sr + '.oldMinX', 0) cmds.setAttr(lip_flip_sr + '.maxX', 0) cmds.setAttr(lip_flip_sr + '.minX', 1) if counter == (half_val - 1): cmds.setAttr(lip_flip_sr + '.minX', 0.5) cmds.connectAttr(lip_sr + '.outValueX', lip_flip_sr + '.valueX', f=True) if counter == (half_val - 1): cmds.connectAttr(lip_sr + '.outValueX', mid_pma + '.input2D[1].input2Dx', f=True) cmds.connectAttr(lip_flip_sr + '.outValueX', mid_pma + '.input2D[1].input2Dy', f=True) cmds.connectAttr(mid_pma + '.output2Dx', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[0].targetWeights[' + str(int(counter)) + ']', f=True) cmds.connectAttr(mid_pma + '.output2Dy', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[1].targetWeights[' + str(int(counter)) + ']', f=True) else: cmds.connectAttr(lip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[0].targetWeights[' + str(int(counter)) + ']', f=True) cmds.connectAttr(lip_flip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[1].targetWeights[' + str(int(counter)) + ']', f=True) counter = counter + 1 rev_counter = rev_counter - 1 name_counter = name_counter + 1 upr_lip_wire_crv1 = cmds.duplicate("upr_lip_wire_crv", rr=True, name="upr_lip_wire_crv1")[0] upr_lip_wire_crv2 = cmds.duplicate("upr_lip_wire_crv", rr=True, name="upr_lip_wire_crv2")[0] cmds.xform(upr_lip_wire_crv1, cp=True) cmds.xform(upr_lip_wire_crv2, cp=True) cmds.setAttr(upr_lip_wire_crv1 + ".translateZ", 0.2) cmds.setAttr(upr_lip_wire_crv2 + ".translateZ", -0.2) lofted_surface = cmds.loft(upr_lip_wire_crv2, upr_lip_wire_crv1, ch=True, u=1, c=0, ar=True, d=3, ss=1, rn=0, po=0, rsn=True)[0] cmds.rename('upperLip_ribbon') cmds.delete('upr_lip_wire_crv1') cmds.delete('upr_lip_wire_crv2') lwr_lip_wire_crv1 = cmds.duplicate("lwr_lip_wire_crv", rr=True, name="lwr_lip_wire_crv1")[0] lwr_lip_wire_crv2 = cmds.duplicate("lwr_lip_wire_crv", rr=True, name="lwr_lip_wire_crv2")[0] cmds.xform(lwr_lip_wire_crv1, cp=True) cmds.xform(lwr_lip_wire_crv2, cp=True) cmds.setAttr(lwr_lip_wire_crv1 + ".translateZ", 0.2) cmds.setAttr(lwr_lip_wire_crv2 + ".translateZ", -0.2) lofted_surface = cmds.loft(lwr_lip_wire_crv2, lwr_lip_wire_crv1, ch=True, u=1, c=0, ar=True, d=3, ss=1, rn=0, po=0, rsn=True)[0] cmds.rename('lowerLip_ribbon') cmds.delete('lwr_lip_wire_crv1') cmds.delete('lwr_lip_wire_crv2') #upper lip num_spans_u = cmds.getAttr('upperLip_ribbon.spansU') for u in range(num_spans_u + 1): cmds.select('upperLip_ribbon.sf[{}][0]'.format(u), add=True) cmds.Rivet() uvPinOut = cmds.ls(sl=True) uvPin = uvPinOut.pop(0) pinOutput_objects = cmds.ls("pinOutput*", type="transform") pinOutput_objects.sort() index = 1 for obj in pinOutput_objects: new_name = "uprLipRivet{}".format(index) cmds.rename(obj, new_name) index += 1 cmds.select(clear=1) locators = cmds.ls('uprLipRivet*', type='transform') joints = [] for locator in locators: position = cmds.xform(locator, query=True, translation=True, worldSpace=True) joint = cmds.joint(position=position, name=locator.replace("uprLipRivet", "uprLipJoint")) joints.append(joint) joints = cmds.ls('uprLipJoint*', type='joint') for joint in joints: parent = cmds.listRelatives(joint, parent=True) if parent and parent[0] != 'world': cmds.parent(joint, world=True) locators = cmds.ls('uprLipRivet*', type='transform') joint = cmds.ls('uprLipJoint*', type='joint') for locator, joint in zip(locators, joints): cmds.parentConstraint(locator, joint, maintainOffset=True) #lower lip cmds.select(clear=1) num_spans_u = cmds.getAttr('lowerLip_ribbon.spansU') for u in range(num_spans_u + 1): cmds.select('lowerLip_ribbon.sf[{}][0]'.format(u), add=True) cmds.Rivet() uvPinOut = cmds.ls(sl=True) uvPin = uvPinOut.pop(0) pinOutput_objects = cmds.ls("pinOutput*", type="transform") pinOutput_objects.sort() index = 1 for obj in pinOutput_objects: new_name = "lwrLipRivet{}".format(index) cmds.rename(obj, new_name) index += 1 cmds.select(clear=1) locators = cmds.ls('lwrLipRivet*', type='transform') joints = [] for locator in locators: position = cmds.xform(locator, query=True, translation=True, worldSpace=True) joint = cmds.joint(position=position, name=locator.replace("lwrLipRivet", "lwrLipJoint")) joints.append(joint) joints = cmds.ls('lwrLipJoint*', type='joint') for joint in joints: parent = cmds.listRelatives(joint, parent=True) if parent and parent[0] != 'world': cmds.parent(joint, world=True) locators = cmds.ls('lwrLipRivet*', type='transform') joint = cmds.ls('lwrLipJoint*', type='joint') for locator, joint in zip(locators, joints): cmds.parentConstraint(locator, joint, maintainOffset=True) cmds.select('upperLip_ribbon', replace=True) cmds.select('upr_lip_wire_crv', add=True) wire_deformer = cmds.wire('upperLip_ribbon',n='upperLipStickyWire', wire=cmds.ls(selection=True)[1]) cmds.setAttr('upperLipStickyWire.dropoffDistance[0]', 10) cmds.select('lowerLip_ribbon', replace=True) cmds.select('lwr_lip_wire_crv', add=True) wire_deformer = cmds.wire('lowerLip_ribbon',n='lowerLipStickyWire', wire=cmds.ls(selection=True)[1]) cmds.setAttr('lowerLipStickyWire.dropoffDistance[0]', 10) num_cvs = cmds.getAttr('lwr_lip_bound_crv.degree') + cmds.getAttr('lwr_lip_bound_crv.spans') + 1 num_joints = num_cvs // 4 for i in range(num_joints): cv_index = i * 4 cv_position = cmds.pointPosition('lwr_lip_bound_crv.cv[{}]'.format(cv_index), world=True) joint = cmds.joint(position=cv_position, name='lwr_lip_joint_{}'.format(i+1)) last_cv_position = cmds.pointPosition('lwr_lip_bound_crv.cv[{}]'.format(num_cvs - 1), world=True) last_joint = cmds.joint(position=last_cv_position, name='lwr_lip_joint_{}'.format(num_joints + 1)) joints_to_unparent = cmds.ls('lwr_lip_joint_1', dag=True, type='joint') for joint in joints_to_unparent: cmds.parent(joint, world=True) num_cvs = cmds.getAttr('upr_lip_bound_crv.degree') + cmds.getAttr('upr_lip_bound_crv.spans') + 1 num_joints = num_cvs // 4 for i in range(num_joints): cv_index = i * 4 cv_position = cmds.pointPosition('upr_lip_bound_crv.cv[{}]'.format(cv_index), world=True) joint = cmds.joint(position=cv_position, name='upr_lip_joint_{}'.format(i+1)) last_cv_position = cmds.pointPosition('upr_lip_bound_crv.cv[{}]'.format(num_cvs - 1), world=True) last_joint = cmds.joint(position=last_cv_position, name='upr_lip_joint_{}'.format(num_joints + 1)) joints_to_unparent = cmds.ls('upr_lip_joint_1', dag=True, type='joint') for joint in joints_to_unparent: cmds.parent(joint, world=True) cmds.select(['lwr_lip_joint_1', 'lwr_lip_joint_2', 'lwr_lip_joint_3', 'lwr_lip_joint_4', 'lwr_lip_joint_5', 'lwr_lip_joint_6', 'lwr_lip_joint_7', 'lwr_lip_bound_crv'], replace=True) cmds.skinCluster(name='lwrLipSkinCrv') cmds.select(['lwr_lip_joint_1', 'upr_lip_joint_2', 'upr_lip_joint_3', 'upr_lip_joint_4', 'upr_lip_joint_5', 'upr_lip_joint_6', 'lwr_lip_joint_7', 'upr_lip_bound_crv'], replace=True) cmds.skinCluster(name='uprLipSkinCrv') cmds.select(['lwr_lip_joint_1', 'lwr_lip_joint_7', 'lwr_lip_sticky_crv'], replace=True) cmds.skinCluster(name='lwrLipStickySkinCrv') cmds.select(['lwr_lip_joint_1', 'lwr_lip_joint_7', 'upr_lip_sticky_crv'], replace=True) cmds.skinCluster(name='lwrLipStickySkinCrv') def create_circle_controller(name, size=1): circle = cmds.circle(name=name, ch=False, radius=size)[0] cmds.setAttr(circle+'.overrideEnabled',1) cmds.setAttr(circle + ".overrideColor" ,18) return circle def create_group(name): return cmds.group(name=name, empty=True) joint_names = ['lwr_lip_joint_1', 'lwr_lip_joint_2', 'lwr_lip_joint_3', 'lwr_lip_joint_4', 'lwr_lip_joint_5', 'lwr_lip_joint_6', 'lwr_lip_joint_7', 'upr_lip_joint_2', 'upr_lip_joint_3', 'upr_lip_joint_4', 'upr_lip_joint_5', 'upr_lip_joint_6'] for joint_name in joint_names: controller_name = joint_name.replace('_joint', '_ctrl') controller = create_circle_controller(controller_name) group_name = controller_name.replace('_ctrl', '_grp') controller_group = create_group(group_name) cmds.matchTransform(controller_group, joint_name, pos=True) cmds.parent(controller, controller_group) list = [('lwr_lip_ctrl_1'),('lwr_lip_ctrl_2'),('lwr_lip_ctrl_3'),('lwr_lip_ctrl_4'),('lwr_lip_ctrl_5'),('lwr_lip_ctrl_6'),('lwr_lip_ctrl_7'),('upr_lip_ctrl_2'),('upr_lip_ctrl_3'),('upr_lip_ctrl_4'),('upr_lip_ctrl_5'),('upr_lip_ctrl_6')] for each in list: cmds.setAttr(each+'.translateX',0) cmds.setAttr(each+'.translateY',0) cmds.setAttr(each+'.translateZ',0) controller_names = ['lwr_lip_ctrl_1','lwr_lip_ctrl_2','lwr_lip_ctrl_3','lwr_lip_ctrl_4','lwr_lip_ctrl_5','lwr_lip_ctrl_6','lwr_lip_ctrl_7','upr_lip_ctrl_2','upr_lip_ctrl_3','upr_lip_ctrl_4','upr_lip_ctrl_5','upr_lip_ctrl_6'] joint_names = ['lwr_lip_joint_1','lwr_lip_joint_2','lwr_lip_joint_3','lwr_lip_joint_4','lwr_lip_joint_5','lwr_lip_joint_6','lwr_lip_joint_7','upr_lip_joint_2','upr_lip_joint_3','upr_lip_joint_4','upr_lip_joint_5','upr_lip_joint_6'] for controller, joint in zip(controller_names, joint_names): cmds.parentConstraint(controller, joint, maintainOffset=True) list = [('lip_crv_grp'),('lip_ribbon_grp'),('lip_rivet_grp'),('lip_jnt_grp'),('lip_setup_grp')] for each in list: cmds.group(n=each,em=True) list = [('lwr_lip_joint_1'),('lwr_lip_joint_2'),('lwr_lip_joint_3'),('lwr_lip_joint_4'),('lwr_lip_joint_5'),('upr_lip_joint_2'),('upr_lip_joint_3'),('upr_lip_joint_4')] for each in list: cmds.parent(each,'lip_jnt_grp') list = ['upr_lip_wire_crv','lwr_lip_crv','lwr_lip_bound_crv','lwr_lip_sticky_crv','lwr_lip_wire_crv','upr_lip_crv','upr_lip_bound_crv','upr_lip_sticky_crv','upr_lip_wire_crvBaseWire','lwr_lip_wire_crvBaseWire'] for each in list: cmds.parent(each,'lip_crv_grp') list = [('lip_crv_grp','lip_setup_grp'),('lip_ribbon_grp','lip_setup_grp'),('lip_rivet_grp','lip_setup_grp'),('lip_jnt_grp','lip_setup_grp')] for each in list: cmds.parent(each[0],each[1]) cmds.setAttr('lip_setup_grp.visibility',0) cmds.parent('upperLip_ribbon','lip_ribbon_grp') cmds.parent('lowerLip_ribbon','lip_ribbon_grp') uprLipRivet_objects = cmds.ls('uprLipRivet*', type='transform') cmds.parent(uprLipRivet_objects,'lip_rivet_grp') lwrLipRivet_objects = cmds.ls('lwrLipRivet*', type='transform') cmds.parent(lwrLipRivet_objects,'lip_rivet_grp') lwrLipJoint_objects = cmds.ls('lwrLipJoint*', type='transform') cmds.parent(lwrLipJoint_objects,head_joint_name) uprLipJoint_objects = cmds.ls('uprLipJoint*', type='transform') cmds.parent(uprLipJoint_objects,head_joint_name) def build_inner_eyebrow_locator(*args): selection = cmds.ls(selection=True, flatten=True) if not selection: cmds.warning("Please select a vertex.") return vertex = selection[0] vertex_position = cmds.pointPosition(vertex, world=True) locator = cmds.spaceLocator(n='l_inr_eyebrow_loc')[0] cmds.move(vertex_position[0], vertex_position[1], vertex_position[2], locator) def build_middle_eyebrow_locator(*args): selection = cmds.ls(selection=True, flatten=True) if not selection: cmds.warning("Please select a vertex.") return vertex = selection[0] vertex_position = cmds.pointPosition(vertex, world=True) locator = cmds.spaceLocator(n='l_mid_eyebrow_loc')[0] cmds.move(vertex_position[0], vertex_position[1], vertex_position[2], locator) def build_outer_eyebrow_locator(*args): selection = cmds.ls(selection=True, flatten=True) if not selection: cmds.warning("Please select a vertex.") return vertex = selection[0] vertex_position = cmds.pointPosition(vertex, world=True) locator = cmds.spaceLocator(n='l_otr_eyebrow_loc')[0] cmds.move(vertex_position[0], vertex_position[1], vertex_position[2], locator) def build_cheek_locator(*args): selection = cmds.ls(selection=True, flatten=True) if not selection: cmds.warning("Please select a vertex.") return vertex = selection[0] vertex_position = cmds.pointPosition(vertex, world=True) locator = cmds.spaceLocator(n='l_cheek_loc')[0] cmds.move(vertex_position[0], vertex_position[1], vertex_position[2], locator) def build_all(*args): list = [('l_inr_eyebrow_loc'),('l_mid_eyebrow_loc'),('l_otr_eyebrow_loc'),('l_cheek_loc')] for each in list: cmds.duplicate(each) list = [('l_inner_eyebrow_ctrl','l_inner_eyebrow_ctrl_grp'),('l_middle_eyebrow_ctrl','l_middle_eyebrow_ctrl_grp'),('l_outer_eyebrow_ctrl','l_outer_eyebrow_ctrl_grp'),('l_cheek_ctrl','l_cheek_ctrl_grp'),('r_inner_eyebrow_ctrl','r_inner_eyebrow_ctrl_grp'),('r_middle_eyebrow_ctrl','r_middle_eyebrow_ctrl_grp'),('r_outer_eyebrow_ctrl','r_outer_eyebrow_ctrl_grp'),('r_cheek_ctrl','r_cheek_ctrl_grp')] for each in list: circle = cmds.circle(n=each[0]) cmds.group(n=each[1]) list = [('l_inner_eyebrow_ctrl'),('l_middle_eyebrow_ctrl'),('l_outer_eyebrow_ctrl'),('l_cheek_ctrl'),('r_inner_eyebrow_ctrl'),('r_middle_eyebrow_ctrl'),('r_outer_eyebrow_ctrl'),('r_cheek_ctrl')] for each in list: cmds.setAttr(each + '.overrideEnabled',1) cmds.setAttr(each + ".overrideColor" ,18) list = [('l_inr_eyebrow_loc1','r_inr_eyebrow_loc'),('l_mid_eyebrow_loc1','r_mid_eyebrow_loc'),('l_otr_eyebrow_loc1','r_otr_eyebrow_loc'),('l_cheek_loc1','r_cheek_loc')] for each in list: cmds.rename(each[0],each[1]) cmds.group(n='r_eyebrow_cheek_loc_grp',em=True) list = [('r_inr_eyebrow_loc'),('r_mid_eyebrow_loc'),('r_otr_eyebrow_loc'),('r_cheek_loc')] for each in list: cmds.parent(each,'r_eyebrow_cheek_loc_grp') cmds.setAttr('r_eyebrow_cheek_loc_grp.scaleX',-1) list = [('l_inr_eyebrow_loc','l_inner_eyebrow_ctrl_grp'),('l_mid_eyebrow_loc','l_middle_eyebrow_ctrl_grp'),('l_otr_eyebrow_loc','l_outer_eyebrow_ctrl_grp'),('l_cheek_loc','l_cheek_ctrl_grp'),('r_inr_eyebrow_loc','r_inner_eyebrow_ctrl_grp'),('r_mid_eyebrow_loc','r_middle_eyebrow_ctrl_grp'),('r_otr_eyebrow_loc','r_outer_eyebrow_ctrl_grp'),('r_cheek_loc','r_cheek_ctrl_grp')] for each in list: forDel = cmds.parentConstraint(each[0],each[1],mo=False) cmds.delete(forDel) list = [('l_inr_eyebrow_jnt'),('l_mid_eyebrow_jnt'),('l_otr_eyebrow_jnt'),('l_cheek_jnt'),('r_inr_eyebrow_jnt'),('r_mid_eyebrow_jnt'),('r_otr_eyebrow_jnt'),('r_cheek_jnt')] for each in list: cmds.joint(n=each) list = [('l_inner_eyebrow_ctrl','l_inr_eyebrow_jnt'),('l_middle_eyebrow_ctrl','l_mid_eyebrow_jnt'),('l_outer_eyebrow_ctrl','l_otr_eyebrow_jnt'),('l_cheek_ctrl','l_cheek_jnt'),('r_inner_eyebrow_ctrl','r_inr_eyebrow_jnt'),('r_middle_eyebrow_ctrl','r_mid_eyebrow_jnt'),('r_outer_eyebrow_ctrl','r_otr_eyebrow_jnt'),('r_cheek_ctrl','r_cheek_jnt')] for each in list: forDel = cmds.parentConstraint(each[0],each[1],mo=False) cmds.delete(forDel) cmds.makeIdentity( 'l_inr_eyebrow_jnt', apply=True, translate=True, rotate=True ) list = [('l_inner_eyebrow_ctrl','l_inr_eyebrow_jnt'),('l_middle_eyebrow_ctrl','l_mid_eyebrow_jnt'),('l_outer_eyebrow_ctrl','l_otr_eyebrow_jnt'),('l_cheek_ctrl','l_cheek_jnt'),('r_inner_eyebrow_ctrl','r_inr_eyebrow_jnt'),('r_middle_eyebrow_ctrl','r_mid_eyebrow_jnt'),('r_outer_eyebrow_ctrl','r_otr_eyebrow_jnt'),('r_cheek_ctrl','r_cheek_jnt')] for each in list: cmds.parentConstraint(each[0],each[1],mo=False) cmds.group(n='eyebrow_cheek_grp',em=True) list = [('l_inr_eyebrow_jnt'),('l_mid_eyebrow_jnt'),('l_otr_eyebrow_jnt'),('l_cheek_jnt'),('r_inr_eyebrow_jnt'),('r_mid_eyebrow_jnt'),('r_otr_eyebrow_jnt'),('r_cheek_jnt')] for each in list: cmds.parent(each,'eyebrow_cheek_grp') list = [('l_inr_eyebrow_loc'),('l_mid_eyebrow_loc'),('l_otr_eyebrow_loc'),('l_cheek_loc'),('r_eyebrow_cheek_loc_grp')] for each in list: cmds.delete(each) #------------------------------------------------------------------------------------------------# # ______________ _____ ___ _____ . _______ _____ # # | | \ \ / \ / / / \ | \ | | # # | __________| \ \ / \ / / / \ | \ | | # # | | \ \ / \ / / / \ | |\ \ | | # # | |__________ \ \ / . \ / / / . \ | | \ \ | | # # | | \ \ / / \ \ / / / / \ \ | | \ \ | | # # | __________| \ \/ / \ \/ / / /___\ \ | | \ \ | | # # | | \ / \ / / _____ \ | | \ \| | # # | |__________ \ / \ / / / \ \ | | \ | # # | | \ / \ / / / \ \ | | \ | # # |______________| \__/ \__/ /___/ \___\ |___| \_____| # # # #------------------------------------------------------------------------------------------------# ui()
def IKlegSetup(side): list = ['%s_ik_leg_01_jnt'%(side),'%s_ik_leg_02_jnt'%(side),'%s_ik_leg_03_jnt'%(side),'%s_ik_leg_04_jnt'%(side),'%s_ik_leg_05_jnt'%(side)] for each in list: cmds.joint(n=each) list = [('%s_leg_01_setup'%(side),'%s_ik_leg_01_jnt'%(side)),('%s_leg_02_setup'%(side),'%s_ik_leg_02_jnt'%(side)),('%s_leg_03_setup'%(side),'%s_ik_leg_03_jnt'%(side)),('%s_leg_04_setup'%(side),'%s_ik_leg_04_jnt'%(side)),('%s_leg_05_setup'%(side),'%s_ik_leg_05_jnt'%(side))] for each in list: forDel = cmds.parentConstraint(each[0],each[1],mo=False) cmds.delete(forDel) cmds.makeIdentity('%s_ik_leg_01_jnt'%(side), apply=True, translate=True, rotate=True) cmds.group(n='%s_ik_leg_jnt_grp'%(side),em=True) cmds.parent('%s_ik_leg_01_jnt'%(side),'%s_ik_leg_jnt_grp'%(side)) cmds.scaleConstraint('world_ctrl','%s_ik_leg_jnt_grp'%(side)) cmds.ikHandle( n='%s_leg_01_ikh'%(side), sj='%s_ik_leg_01_jnt'%(side), ee='%s_ik_leg_03_jnt'%(side) ) cmds.ikHandle( n='%s_leg_02_ikh'%(side), sj='%s_ik_leg_03_jnt'%(side), ee='%s_ik_leg_04_jnt'%(side) ) cmds.ikHandle( n='%s_leg_03_ikh'%(side), sj='%s_ik_leg_04_jnt'%(side), ee='%s_ik_leg_05_jnt'%(side) ) cmds.parentConstraint('spine_01_bln_jnt','%s_ik_leg_01_jnt'%(side),mo = True) cmds.curve(d=1, p=[(-5, -5, 5),(-5, 5, 5),(5, 5, 5),(5, -5, 5),(5, -5, -5),(5, 5, -5),(-5, 5, -5),(-5, -5, -5),(-5, -5, 5),(5, -5, 5),(5, 5, 5),(5, 5, -5),(5, -5, -5),(-5, -5, -5),(-5, 5, -5),(-5, 5, 5)]) cmds.rename('%s_ik_leg_ctrl'%(side)) ControllerAttr('%s_ik_leg_ctrl'%(side),False,False,False,False,True,True,True,True,True,True,True,False,False,False,True,6,True,True,True,False,False,False) cmds.addAttr('%s_ik_leg_ctrl'%(side),sn='heelLift' ,k=1) cmds.addAttr('%s_ik_leg_ctrl'%(side),sn='toeLift' ,k=1) cmds.addAttr('%s_ik_leg_ctrl'%(side),sn='ballRoll' ,k=1) cmds.addAttr('%s_ik_leg_ctrl'%(side),sn='toeRoll' ,k=1) cmds.addAttr('%s_ik_leg_ctrl'%(side),sn='footRock' ,k=1) cmds.addAttr('%s_ik_leg_ctrl'%(side),sn='stretch' ,k=1,at = 'bool') cmds.addAttr('%s_ik_leg_ctrl'%(side), at = 'enum', keyable=True, en = 'string1:string2:', ln='follow') cmds.addAttr('%s_ik_leg_ctrl'%(side)+'.follow', e=True, en = 'world:pelvis:') cmds.group(n='%s_ik_leg_ctrl_grp'%(side)) forDel = cmds.parentConstraint('%s_leg_03_setup'%(side),'%s_ik_leg_ctrl_grp'%(side),mo = False) deleteparent = cmds.delete(forDel) cmds.parentConstraint('spine_01_bln_jnt','%s_ik_leg_ctrl_grp'%(side),mo = True) cmds.connectAttr('%s_ik_leg_ctrl.follow'%(side),'%s_ik_leg_ctrl_grp_parentConstraint1.spine_01_bln_jntW0'%(side)) cmds.curve(n='%s_knee_ctrl'%(side),d=1,p=[(0.0, 3.468342867164149, 0.0),(0.0, 3.468342867164149, 0.5221724371834184),(0.0, 4.967930096687364, 0.0),(0.5221724371834184, 3.468342867164149, 0.0),(-0.5221724371834184, 3.468342867164149, 0.0),(0.0, 4.967930096687364, 0.0),(0.0, 3.468342867164149, -0.5221724371834184),(0.0, 3.468342867164149, 0.0),(0.0, -3.468342867164149, 0.0),(-0.5221724371834184, -3.468342867164149, 0.0),(0.0, -4.967930096687364, 0.0),(0.0, -3.468342867164149, -0.5221724371834184),(0.0, -3.468342867164149, 0.5221724371834184),(0.0, -4.967930096687364, 0.0),(0.5221724371834184, -3.468342867164149, 0.0),(0.0, -3.468342867164149, 0.0),(0.0, 0.0, 0.0),(-3.468342867164149, 0.0, 0.0),(-3.468342867164149, 0.5221724371834184, 0.0),(-4.967930096687364, 0.0, 0.0),(-3.468342867164149, 0.0, -0.5221724371834184),(-3.468342867164149, 0.0, 0.5221724371834184),(-4.967930096687364, 0.0, 0.0),(-3.468342867164149, -0.5221724371834184, 0.0),(-3.468342867164149, 0.0, 0.0),(3.468342867164149, 0.0, 0.0),(3.468342867164149, 0.0, -0.5221724371834184),(4.967930096687364, 0.0, 0.0),(3.468342867164149, 0.5221724371834184, 0.0),(3.468342867164149, -0.5221724371834184, 0.0),(4.967930096687364, 0.0, 0.0),(3.468342867164149, 0.0, 0.5221724371834184),(3.468342867164149, 0.0, 0.0),(0.0, 0.0, 0.0),(0.0, 0.0, 3.468342867164149),(0.0, 0.5221724371834184, 3.468342867164149),(0.0, 0.0, 4.967930096687364),(0.5221724371834184, 0.0, 3.468342867164149),(-0.5221724371834184, 0.0, 3.468342867164149),(0.0, 0.0, 4.967930096687364),(0.0, -0.5221724371834184, 3.468342867164149),(0.0, 0.0, 3.468342867164149),(0.0, 0.0, -3.468342867164149),(0.0, 0.5221724371834184, -3.468342867164149),(0.0, 0.0, -4.967930096687364),(-0.5221724371834184, 0.0, -3.468342867164149),(0.5221724371834184, 0.0, -3.468342867164149),(0.0, 0.0, -4.967930096687364),(0.0, -0.5221724371834184, -3.468342867164149),(0.0, 0.0, -3.468342867164149),(0.0, 0.0, -3.468342867164149),(0.0, 0.0, -3.468342867164149),(0.0, 0.0, -3.468342867164149)]) ControllerAttr('%s_knee_ctrl'%(side),False,False,False,False,False,False,False,True,True,True,True,True,True,True,True,6,True,True,True,False,False,False) cmds.addAttr('%s_knee_ctrl'%(side),sn='follow', min = 0, max=1 ,k=1) cmds.setAttr('%s_knee_ctrl.follow'%(side),1) cmds.group(n='%s_knee_ctrl_grp'%(side)) cmds.parent('%s_knee_ctrl_grp'%(side),'world_ctrl') forDel = cmds.pointConstraint('%s_knee_setup'%(side),'%s_knee_ctrl_grp'%(side)) cmds.delete(forDel) cmds.poleVectorConstraint('%s_knee_ctrl'%(side),'%s_leg_01_ikh'%(side)) list = ['%s_knee_ctrl_aim_up_loc'%(side),'%s_knee_ctrl_aim_base_loc'%(side),'%s_knee_ctrl_aim_loc'%(side),'%s_knee_ctrl_aim_world_loc'%(side),'%s_heel_loc'%(side),'%s_roll_out_loc'%(side),'%s_roll_in_loc'%(side),'%s_toe_roll_loc'%(side),'%s_toe_end_loc'%(side),'%s_toe_lift_loc'%(side),'%s_ball_roll_loc'%(side),'%s_leg_ikHandle_loc'%(side),'%s_ball_ikHandle_loc'%(side)] for each in list: cmds.spaceLocator(n=each) cmds.group(n='%s_knee_loc_grp'%(side),em=True) cmds.scaleConstraint('world_ctrl','%s_knee_loc_grp'%(side),mo=True) cmds.group(n='%s_foot_ikHandle_grp'%(side),em = True) cmds.group(n='%s_knee_ctrl_aim_base_loc_grp'%(side),em=True) list = [('pelvis_setup','%s_knee_ctrl_aim_up_loc'%(side)),('%s_leg_01_setup'%(side),'%s_knee_ctrl_aim_base_loc'%(side)),('%s_leg_03_setup'%(side),'%s_knee_ctrl_aim_loc'%(side))] for each in list: forDel = cmds.pointConstraint(each[0],each[1]) cmds.delete(forDel) list = [('%s_leg_04_setup'%(side),'%s_toe_roll_loc'%(side)),('%s_leg_04_setup'%(side),'%s_ball_roll_loc'%(side)),('%s_knee_setup'%(side),'%s_knee_ctrl_aim_world_loc'%(side)),('%s_leg_heel_setup'%(side),'%s_heel_loc'%(side)),('%s_leg_roll_out_setup'%(side),'%s_roll_out_loc'%(side)),('%s_leg_roll_in_setup'%(side),'%s_roll_in_loc'%(side)),('%s_leg_05_setup'%(side),'%s_toe_end_loc'%(side)),('%s_leg_06_setup'%(side),'%s_toe_lift_loc'%(side)),('%s_leg_03_setup'%(side),'%s_leg_ikHandle_loc'%(side)),('%s_leg_04_setup'%(side),'%s_ball_ikHandle_loc'%(side)),('%s_leg_03_setup'%(side),'%s_foot_ikHandle_grp'%(side))] for each in list: forDel = cmds.parentConstraint(each[0],each[1],mo=False) cmds.delete(forDel) list = [('%s_heel_loc'%(side),'%s_toe_roll_loc'%(side)),('%s_heel_loc'%(side),'%s_ball_roll_loc'%(side)),('%s_heel_loc'%(side),'%s_foot_ikHandle_grp'%(side))] for each in list: forDel = cmds.orientConstraint(each[0],each[1],mo=False) cmds.delete(forDel) list = [('%s_toe_lift_loc'%(side),'%s_heel_loc'%(side)),('%s_roll_out_loc'%(side),'%s_toe_lift_loc'%(side)),('%s_roll_in_loc'%(side),'%s_roll_in_loc'%(side)),('%s_toe_roll_loc'%(side),'%s_roll_in_loc'%(side)),('%s_ball_roll_loc'%(side),'%s_roll_in_loc'%(side)),('%s_toe_end_loc'%(side),'%s_toe_roll_loc'%(side)),('%s_leg_ikHandle_loc'%(side),'%s_ball_roll_loc'%(side)),('%s_ball_ikHandle_loc'%(side),'%s_ball_roll_loc'%(side)),('%s_leg_02_ikh'%(side),'%s_ball_ikHandle_loc'%(side)),('%s_leg_03_ikh'%(side),'%s_toe_end_loc'%(side)),('%s_leg_01_ikh'%(side),'%s_leg_ikHandle_loc'%(side)),('%s_knee_ctrl_aim_world_loc'%(side),'%s_knee_loc_grp'%(side)),('%s_heel_loc'%(side),'%s_foot_ikHandle_grp'%(side)),('%s_ik_leg_ctrl_grp'%(side),'world_ctrl'),('%s_knee_ctrl_aim_base_loc'%(side),'%s_knee_ctrl_aim_base_loc_grp'%(side)),('%s_knee_ctrl_aim_up_loc'%(side),'%s_knee_loc_grp'%(side)),('%s_knee_ctrl_aim_base_loc_grp'%(side),'%s_knee_loc_grp'%(side)),('%s_knee_ctrl_aim_loc'%(side),'%s_knee_loc_grp'%(side)),('%s_knee_ctrl_aim_up_loc'%(side),'spine_01_bln_jnt')] for each in list: cmds.parent(each[0],each[1]) cmds.aimConstraint('%s_knee_ctrl_aim_loc'%(side),'%s_knee_ctrl_aim_base_loc'%(side),wut='object',wuo = '%s_knee_ctrl_aim_up_loc'%(side),mo = False) list = [('%s_ik_leg_ctrl'%(side),'%s_knee_ctrl_aim_loc'%(side)),('world_ctrl','%s_knee_ctrl_aim_world_loc'%(side)),('%s_knee_ctrl_aim_base_loc'%(side),'%s_knee_ctrl_grp'%(side)),('%s_knee_ctrl_aim_world_loc'%(side),'%s_knee_ctrl_grp'%(side)),('%s_ik_leg_ctrl'%(side),'%s_foot_ikHandle_grp'%(side)),('%s_knee_ctrl_aim_up_loc'%(side),'%s_knee_ctrl_aim_base_loc_grp'%(side))] for each in list: cmds.parentConstraint(each[0],each[1],mo=True) list = [('reverse','%s_knee_follow_rev'%(side)),('multiplyDivide','%s_foot_rock_mult'%(side)),('condition','%s_foot_rock_con'%(side))] for each in list: cmds.shadingNode(each[0],n = each[1],asUtility=1) list = [('%s_knee_ctrl.follow'%(side),'%s_knee_ctrl_grp_parentConstraint1.%s_knee_ctrl_aim_base_locW0'%(side,side)),('%s_knee_ctrl.follow'%(side),'%s_knee_follow_rev.inputX'%(side)),('%s_knee_follow_rev.outputX'%(side),'%s_knee_ctrl_grp_parentConstraint1.%s_knee_ctrl_aim_world_locW1'%(side,side)),('%s_ik_leg_ctrl.heelLift'%(side),'%s_heel_loc.rotateZ'%(side)),('%s_ik_leg_ctrl.toeLift'%(side),'%s_toe_lift_loc.rotateZ'%(side)),('%s_ik_leg_ctrl.ballRoll'%(side),'%s_ball_roll_loc.rotateZ'%(side)),('%s_ik_leg_ctrl.toeRoll'%(side),'%s_toe_roll_loc.rotateZ'%(side)),('%s_ik_leg_ctrl.footRock'%(side),'%s_foot_rock_mult.input1X'%(side)),('%s_ik_leg_ctrl.footRock'%(side),'%s_foot_rock_mult.input1Y'%(side)),('%s_foot_rock_mult.outputX'%(side),'%s_foot_rock_con.colorIfFalse.colorIfFalseG'%(side)),('%s_foot_rock_mult.outputX'%(side),'%s_foot_rock_con.colorIfTrue.colorIfTrueR'%(side)),('%s_foot_rock_con.outColor.outColorR'%(side), '%s_roll_out_loc.rotate.rotateX'%(side)),('%s_foot_rock_con.outColor.outColorG'%(side), '%s_roll_in_loc.rotate.rotateX'%(side)),('%s_ik_leg_ctrl.footRock'%(side), '%s_foot_rock_con.firstTerm'%(side))] for each in list: cmds.connectAttr(each[0],each[1]) list = [('%s_foot_rock_mult.input2X'%(side),-1),('%s_foot_rock_con.operation'%(side),2),('%s_foot_rock_con.colorIfFalse.colorIfFalseR'%(side),0),('%s_foot_rock_con.colorIfFalse.colorIfFalseB'%(side),0)] for each in list: cmds.setAttr(each[0],each[1]) cmds.scaleConstraint('world_ctrl','%s_foot_ikHandle_grp'%(side),mo=True) #IKlegPVcrv# cmds.curve(d=1, p=[(0, 0, 0),(0, 10, 0)]) cmds.rename('%s_knee_direction_crv'%(side)) nameOfLoc = ['%s_knee_01_loc'%(side),'%s_knee_02_loc'%(side)] for each in nameOfLoc: cmds.spaceLocator(n=each) toGetLocPos = [('%s_knee_01_loc.translateY'%(side),0),('%s_knee_02_loc.translateY'%(side),10)] for each in toGetLocPos: cmds.setAttr(each[0],each[1]) toConnectLoc = [('%s_knee_01_loc.worldPosition[0]'%(side),'%s_knee_direction_crvShape.controlPoints[0]'%(side)),('%s_knee_02_loc.worldPosition[0]'%(side),'%s_knee_direction_crvShape.controlPoints[4]'%(side))] for each in toConnectLoc: cmds.connectAttr(each[0],each[1]) toSetAttr = [('%s_knee_direction_crv.overrideEnabled'%(side),1),('%s_knee_direction_crv.overrideDisplayType'%(side),2),('%s_knee_01_loc.visibility'%(side),0),('%s_knee_02_loc.visibility'%(side),0)] for each in toSetAttr: cmds.setAttr(each[0],each[1]) toGetParent = [('%s_knee_ctrl'%(side),'%s_knee_01_loc'%(side)),('%s_ik_leg_02_jnt'%(side),'%s_knee_02_loc'%(side))] for each in toGetParent: cmds.parentConstraint(each[0],each[1],mo = False) cmds.group(n='%s_knee_direction_crv_grp'%(side),em = True) toGetParent = [('%s_knee_01_loc'%(side),'%s_knee_direction_crv_grp'%(side)),('%s_knee_02_loc'%(side),'%s_knee_direction_crv_grp'%(side)),('%s_knee_direction_crv'%(side),'%s_knee_direction_crv_grp'%(side))] for each in toGetParent: cmds.parent(each[0],each[1]) # the command to change the progress bar cmds.progressBar('EugenesProgressBar', edit=True, step=1) IKlegSetup('l') IKlegSetup('r') def IKFKlegSetup(side): nameOfJoint = [('%s_leg_01_bln_jnt'%(side)),('%s_leg_02_bln_jnt'%(side)),('%s_leg_03_bln_jnt'%(side)),('%s_leg_04_bln_jnt'%(side))] for each in nameOfJoint: cmds.joint(n=each) toGetJointPos = [('%s_leg_01_setup'%(side),'%s_leg_01_bln_jnt'%(side)),('%s_leg_02_setup'%(side),'%s_leg_02_bln_jnt'%(side)),('%s_leg_03_setup'%(side),'%s_leg_03_bln_jnt'%(side)),('%s_leg_04_setup'%(side),'%s_leg_04_bln_jnt'%(side))] for each in toGetJointPos: forDel = cmds.parentConstraint(each[0],each[1],mo = False) cmds.delete(forDel) toSetDrawStyle = [('%s_leg_01_bln_jnt.drawStyle'%(side)),('%s_leg_02_bln_jnt.drawStyle'%(side)),('%s_leg_03_bln_jnt.drawStyle'%(side))] for each in toSetDrawStyle: cmds.setAttr(each,2) cmds.parent(w = True) cmds.makeIdentity( '%s_leg_01_bln_jnt'%(side), apply=True, translate=True, rotate=True ) cmds.curve(d=1, p=[(1.25, 0, 7.5),(-1.25, 0, 7.5),(-1.25, 0, 1.25),(-7.5, 0, 1.25),(-7.5, 0, -1.25),(-1.25, 0, -1.25),(-1.25, 0, -7.5),(1.25, 0 ,-7.5),(1.25, 0, -1.25),(7.5, 0, -1.25),(7.5, 0, 1.25,),(1.25, 0 ,1.25),(1.25, 0, 7.5)]) cmds.rename('%s_leg_ik_fk_switch'%(side)) ControllerAttr('%s_leg_ik_fk_switch'%(side),False,False,False,False,False,False,False,True,True,True,True,True,True,True,True,15,False,False,False,True,True,True) cmds.group(n='%s_leg_ik_fk_switch_grp'%(side)) cmds.parent('%s_leg_ik_fk_switch_grp'%(side), 'world_ctrl') cmds.addAttr('%s_leg_ik_fk_switch'%(side),sn='IKFK', min = 0, max=1 ,k=1) cmds.addAttr('%s_leg_ik_fk_switch'%(side),sn='bendyVis',at = 'bool',k=1) parentCon = [('%s_leg_03_bln_jnt'%(side), '%s_leg_ik_fk_switch_grp'%(side)),('%s_fk_leg_01_jnt'%(side),'%s_leg_01_bln_jnt'%(side)),('%s_ik_leg_01_jnt'%(side),'%s_leg_01_bln_jnt'%(side)),('%s_fk_leg_02_jnt'%(side),'%s_leg_02_bln_jnt'%(side)),('%s_ik_leg_02_jnt'%(side),'%s_leg_02_bln_jnt'%(side)),('%s_fk_leg_03_jnt'%(side),'%s_leg_03_bln_jnt'%(side)),('%s_ik_leg_03_jnt'%(side),'%s_leg_03_bln_jnt'%(side)),('%s_fk_leg_04_jnt'%(side),'%s_leg_04_bln_jnt'%(side)),('%s_ik_leg_04_jnt'%(side),'%s_leg_04_bln_jnt'%(side))] for each in parentCon: cmds.parentConstraint(each[0],each[1],mo = False) cmds.shadingNode('reverse',n = '%s_leg_ik_rev'%(side),asUtility=1) toConnectAttr = [('%s_leg_ik_fk_switch.IKFK'%(side),'%s_leg_01_bln_jnt_parentConstraint1.%s_fk_leg_01_jntW0'%(side,side)),('%s_leg_ik_fk_switch.IKFK'%(side),'%s_leg_02_bln_jnt_parentConstraint1.%s_fk_leg_02_jntW0'%(side,side)),('%s_leg_ik_fk_switch.IKFK'%(side),'%s_leg_03_bln_jnt_parentConstraint1.%s_fk_leg_03_jntW0'%(side,side)),('%s_leg_ik_fk_switch.IKFK'%(side),'%s_leg_04_bln_jnt_parentConstraint1.%s_fk_leg_04_jntW0'%(side,side)),('%s_leg_ik_fk_switch.IKFK'%(side),'%s_leg_ik_rev.inputX'%(side)),('%s_leg_ik_rev.outputX'%(side),'%s_leg_01_bln_jnt_parentConstraint1.%s_ik_leg_01_jntW1'%(side,side)),('%s_leg_ik_rev.outputX'%(side),'%s_leg_02_bln_jnt_parentConstraint1.%s_ik_leg_02_jntW1'%(side,side)),('%s_leg_ik_rev.outputX'%(side),'%s_leg_03_bln_jnt_parentConstraint1.%s_ik_leg_03_jntW1'%(side,side)),('%s_leg_ik_rev.outputX'%(side),'%s_leg_04_bln_jnt_parentConstraint1.%s_ik_leg_04_jntW1'%(side,side)),('%s_leg_ik_fk_switch.IKFK'%(side),'%s_fk_leg_01_ctrl_grp.visibility'%(side)),('%s_leg_ik_rev.outputX'%(side),'%s_ik_leg_ctrl_grp.visibility'%(side)),('%s_leg_ik_rev.outputX'%(side),'%s_knee_ctrl_grp.visibility'%(side)),('%s_leg_ik_rev.outputX'%(side),'%s_knee_direction_crv_grp.visibility'%(side))] for each in toConnectAttr: cmds.connectAttr(each[0],each[1]) cmds.parent('%s_leg_01_bln_jnt'%(side),'spine_01_bln_jnt') cmds.parent('%s_leg_04_bln_jnt'%(side),'%s_leg_03_bln_jnt'%(side)) # the command to change the progress bar cmds.progressBar('EugenesProgressBar', edit=True, step=1) IKFKlegSetup('l') IKFKlegSetup('r') def StrechyLegSetup(side): #StrechyLeg# jointList = ['%s_leg_01_length_jnt'%(side),'%s_leg_02_length_jnt'%(side),'%s_leg_03_length_jnt'%(side)] for each in jointList: cmds.joint(n=each) cmds.group(n='%s_leg_length_jnt_grp'%(side),em=True) cmds.parent('%s_leg_01_length_jnt'%(side),'%s_leg_length_jnt_grp'%(side)) cmds.scaleConstraint('world_ctrl','%s_leg_length_jnt_grp'%(side),mo=True) listOfToGetJointPos = [('%s_leg_01_setup'%(side),'%s_leg_01_length_jnt'%(side)),('%s_leg_02_setup'%(side),'%s_leg_02_length_jnt'%(side)),('%s_leg_03_setup'%(side),'%s_leg_03_length_jnt'%(side))] for each in listOfToGetJointPos: forDel = cmds.parentConstraint(each[0],each[1],mo=False) cmds.delete(forDel) addNode = [('distanceBetween','%s_upr_leg_dist'%(side)),('distanceBetween','%s_lwr_leg_dist'%(side)),('addDoubleLinear','%s_leg_full_dist'%(side)),('distanceBetween','%s_leg_stretch_dist'%(side)),('condition','%s_leg_stretch_cond'%(side)),('multiplyDivide','%s_leg_stretch_mult'%(side)),('multiplyDivide','%s_upr_leg_strecth_mult'%(side)),('multiplyDivide','%s_lwr_leg_strecth_mult'%(side)),('multiplyDivide','%s_leg_strecth_option_mult'%(side))] for each in addNode: cmds.shadingNode(each[0],n=each[1],asUtility=1) cmds.setAttr('%s_leg_stretch_cond.operation'%(side),2) cmds.setAttr('%s_leg_stretch_mult.operation'%(side),2) addLoc = [('%s_leg_start_dist_loc'%(side)),('%s_leg_end_dist_loc'%(side))] for each in addLoc: cmds.spaceLocator(n=each) cmds.group(n='%s_leg_start_dist_loc_grp'%(side),em=True) cmds.parent('%s_leg_start_dist_loc'%(side),'%s_leg_start_dist_loc_grp'%(side)) cmds.scaleConstraint('world_ctrl','%s_leg_start_dist_loc_grp'%(side),mo=True) toConnectNode = [('%s_leg_01_length_jnt.worldMatrix'%(side),'%s_upr_leg_dist.inMatrix1'%(side)),('%s_leg_02_length_jnt.worldMatrix'%(side),'%s_upr_leg_dist.inMatrix2'%(side)),('%s_leg_02_length_jnt.worldMatrix'%(side),'%s_lwr_leg_dist.inMatrix1'%(side)),('%s_leg_03_length_jnt.worldMatrix'%(side),'%s_lwr_leg_dist.inMatrix2'%(side)),('%s_upr_leg_dist.distance'%(side),'%s_leg_full_dist.input1'%(side)),('%s_lwr_leg_dist.distance'%(side),'%s_leg_full_dist.input2'%(side)),('%s_leg_start_dist_loc.worldMatrix'%(side),'%s_leg_stretch_dist.inMatrix1'%(side)),('%s_leg_end_dist_loc.worldMatrix'%(side),'%s_leg_stretch_dist.inMatrix2'%(side)),('%s_leg_stretch_dist.distance'%(side),'%s_leg_stretch_cond.firstTerm'%(side)),('%s_leg_full_dist.output'%(side),'%s_leg_stretch_cond.secondTerm'%(side)),('%s_leg_stretch_dist.distance'%(side),'%s_leg_stretch_mult.input1X'%(side)),('%s_leg_full_dist.output'%(side),'%s_leg_stretch_mult.input2X'%(side)),('%s_leg_stretch_mult.outputX'%(side),'%s_leg_stretch_cond.colorIfTrue.colorIfTrueR'%(side)),('%s_leg_stretch_cond.outColor.outColorR'%(side),'%s_lwr_leg_strecth_mult.input1X'%(side)),('%s_leg_stretch_cond.outColor.outColorR'%(side),'%s_upr_leg_strecth_mult.input1X'%(side)),('%s_leg_02_setup.translateX'%(side),'%s_upr_leg_strecth_mult.input2X'%(side)),('%s_leg_03_setup.translateX'%(side),'%s_lwr_leg_strecth_mult.input2X'%(side)),('%s_upr_leg_strecth_mult.outputX'%(side),'%s_ik_leg_02_jnt.translateX'%(side)),('%s_lwr_leg_strecth_mult.outputX'%(side),'%s_ik_leg_03_jnt.translateX'%(side)),('%s_ik_leg_ctrl.stretch'%(side),'%s_leg_strecth_option_mult.input1X'%(side)),('%s_leg_strecth_option_mult.outputX'%(side),'%s_leg_stretch_cond.operation'%(side))] for each in toConnectNode: cmds.connectAttr(each[0],each[1]) toSetVis = [('%s_leg_start_dist_loc.visibility'%(side)),('%s_leg_end_dist_loc.visibility'%(side))] for each in toSetVis: cmds.setAttr(each,0) toGetLocPos = [('%s_leg_01_setup'%(side),'%s_leg_start_dist_loc'%(side)),('%s_leg_03_setup'%(side),'%s_leg_end_dist_loc'%(side))] for each in toGetLocPos: forDel = cmds.pointConstraint(each[0],each[1],mo = False) cmds.delete(forDel) cmds.parentConstraint('spine_01_bln_jnt','%s_leg_start_dist_loc'%(side),mo=True) cmds.parent('%s_leg_end_dist_loc'%(side),'%s_ik_leg_ctrl'%(side)) cmds.setAttr('%s_leg_strecth_option_mult.input2X'%(side),2) # the command to change the progress bar cmds.progressBar('EugenesProgressBar', edit=True, step=1) StrechyLegSetup('l') StrechyLegSetup('r') def legJointGroup(): cmds.group(n='l_leg_jnt_grp',em=True) cmds.group(n='r_leg_jnt_grp',em=True) cmds.group(n='leg_jnt_grp',em=True) listOfJnt = [('r_leg_01_bln_jnt','r_leg_jnt_grp'),('l_leg_01_bln_jnt','l_leg_jnt_grp'),('l_leg_jnt_grp','leg_jnt_grp'),('r_leg_jnt_grp','leg_jnt_grp'),('l_fk_leg_01_jnt','l_leg_jnt_grp'),('r_fk_leg_01_jnt','r_leg_jnt_grp'),('l_ik_leg_jnt_grp','l_leg_jnt_grp'),('r_ik_leg_jnt_grp','r_leg_jnt_grp'),('r_leg_length_jnt_grp','r_leg_jnt_grp'),('l_leg_length_jnt_grp','l_leg_jnt_grp')] for each in listOfJnt: cmds.parent(each[0],each[1]) legJointGroup() bendyLeglabel = cmds.checkBox('bendyLeg', q=1,label=1) bendyLeglabel = cmds.checkBox('bendyLeg', q=1,v=1 ) if bendyLeglabel == 1: print(buildBendyLeg()) elif bendyLeglabel == 0: print(noBendyLeg()) def neckSetup(): #############necksetupGorup#################################### createJoint = [('neck_01_jnt'),('neck_02_jnt'),('head_jnt')] for each in createJoint: cmds.joint(n=each) cmds.curve(d=1, p=[(0.0, -4.488101857837618, -9.88295369549351),(1.845970443850507, -2.669731881954042, -9.58101846750181),(3.691940887701014, -0.9395124651324274, -8.94542404852105),(5.5379124591137385, 0.6419036933703752, -7.998451067974649),(3.691940887701014, 0.6419036933703752, -7.998451067974649),(1.845970443850507, 0.6419036933703752, -7.998451067974649),(1.845970443850507, 2.0190845073658616, -6.7732938299919585),(1.845970443850507, 3.143754528061804, -5.312898924323979),(1.845970443850507, 3.97648967007558, -3.6684576756581033),(1.8351740356152193, 4.488101857837621, -1.9084097279272163),(3.606018391581394, 3.9764896700755794, -1.9084097279272163),(5.250459640247268, 3.1437545280618036, -1.9084097279272163),(6.710854545915254, 2.0190845073658608, -1.9084097279272163),(7.936011783897939, 0.641903693370374, -1.9084097279272163),(7.936011783897939, 0.641903693370374, -3.7543801717777243),(7.936011783897939, 0.6419036933703747, -5.600351743190446),(8.882984764444341, -0.9395124651324284, -3.7543801717777243),(9.5185791834251, -2.669731881954045, -1.9084097279272174),(9.820514411416799, -4.488101857837621, -0.062439284076711864),(9.5185791834251, -2.669731881954045, 1.783531159773795),(8.882984764444341, -0.9395124651324317, 3.629501603624302),(7.936011783897939, 0.6419036933703725, 5.475473175037026),(7.936011783897939, 0.641903693370373, 3.6295016036243037),(7.936011783897939, 0.641903693370373, 1.7835311597737955),(6.710854545915254, 2.0190845073658603, 1.7835311597737955),(5.250459640247268, 3.1437545280618036, 1.7835311597737957),(3.606018391581394, 3.976489670075578, 1.7835311597737957),(1.8351740356152193, 4.488101857837621, 1.7835311597737964),(1.845970443850507, 3.976489670075578, 3.5435791075046823),(1.845970443850507, 3.143754528061802, 5.188020356170558),(1.845970443850507, 2.0190845073658594, 6.64841526183854),(1.845970443850507, 0.641903693370372, 7.87357249982123),(3.691940887701014, 0.641903693370372, 7.87357249982123),(5.5379124591137385, 0.641903693370372, 7.87357249982123),(3.691940887701014, -0.9395124651324329, 8.820545480367631),(1.845970443850507, -2.6697318819540463, 9.45613989934839),(0.0, -4.488101857837623, 9.758075127340078),(-1.8459704438505065, -2.6697318819540463, 9.45613989934839),(-3.691940887701013, -0.9395124651324329, 8.820545480367631),(-5.537912459113736, 0.641903693370372, 7.87357249982123),(-3.691940887701013, 0.641903693370372, 7.87357249982123),(-1.8459704438505065, 0.641903693370372, 7.87357249982123),(-1.8459704438505065, 2.0190845073658594, 6.64841526183854),(-1.8459704438505065, 3.143754528061802, 5.188020356170558),(-1.8459704438505065, 3.976489670075578, 3.5435791075046823),(-1.835174035615219, 4.488101857837621, 1.7835311597737964),(-3.6060183915813933, 3.976489670075578, 1.7835311597737957),(-5.250459640247268, 3.1437545280618036, 1.7835311597737957),(-6.710854545915253, 2.0190845073658603, 1.7835311597737955),(-7.936011783897938, 0.641903693370373, 1.7835311597737955),(-7.936011783897938, 0.641903693370373, 3.6295016036243037),(-7.936011783897938, 0.6419036933703725, 5.475473175037026),(-8.882984764444341, -0.9395124651324317, 3.629501603624302),(-9.5185791834251, -2.669731881954045, 1.783531159773795),(-9.820514411416799, -4.488101857837621, -0.062439284076711864),(-9.5185791834251, -2.669731881954045, -1.9084097279272174),(-8.882984764444341, -0.9395124651324284, -3.7543801717777243),(-7.936011783897938, 0.6419036933703747, -5.600351743190446),(-7.936011783897938, 0.641903693370374, -3.7543801717777243),(-7.936011783897938, 0.641903693370374, -1.9084097279272163),(-6.710854545915253, 2.0190845073658608, -1.9084097279272163),(-5.250459640247268, 3.1437545280618036, -1.9084097279272163),(-3.6060183915813933, 3.9764896700755794, -1.9084097279272163),(-1.8459704438505065, 4.488101857837621, -1.8976133196919278),(-1.8459704438505065, 3.97648967007558, -3.6684576756581033),(-1.8459704438505065, 3.143754528061804, -5.312898924323979),(-1.8459704438505065, 2.0190845073658616, -6.7732938299919585),(-1.8459704438505065, 0.6419036933703752, -7.998451067974649),(-3.691940887701013, 0.6419036933703752, -7.998451067974649),(-5.537912459113736, 0.6419036933703752, -7.998451067974649),(-3.691940887701013, -0.9395124651324274, -8.94542404852105),(-1.8459704438505065, -2.669731881954042, -9.58101846750181),(0.0, -4.488101857837618, -9.88295369549351)]) cmds.rename('head_ctrl') cmds.group(n='head_ctrl_grp') cmds.curve(d=1,p=[(-7.244192640355521, -0.7593145399841482, 0.0), (-7.244192640355521, 0.7593145399841418, 0.0),(-6.270239916630294, 0.7593145399841422, -3.6201258997795907),(-6.270239916630294, -0.7593145399841478, -3.6201258997795907),(-3.62012589977959, -0.7593145399841466, -6.270239916630294),(-3.620125899779591, 0.7593145399841434, -6.270239916630294),(-3.3720339408922273e-16, 0.759314539984145, -7.244192640355521),(3.3720339408922273e-16, -0.759314539984145, -7.244192640355521),(3.620125899779591, -0.7593145399841434, -6.270239916630294),(3.62012589977959, 0.7593145399841466, -6.270239916630294),(6.270239916630294, 0.7593145399841478, -3.6201258997795907),(6.270239916630294, -0.7593145399841422, -3.6201258997795907),(7.244192640355521, -0.7593145399841418, 0.0),(7.244192640355521, 0.7593145399841482, 0.0),(6.270239916630294, 0.7593145399841478, 3.6201258997795907),(6.270239916630294, -0.7593145399841422, 3.6201258997795907),(3.620125899779591, -0.7593145399841434, 6.270239916630294),(3.62012589977959, 0.7593145399841466, 6.270239916630294),(-3.3720339408922273e-16, 0.759314539984145, 7.244192640355521),(3.3720339408922273e-16, -0.759314539984145, 7.244192640355521),(-3.62012589977959, -0.7593145399841466, 6.270239916630294),(-3.620125899779591, 0.7593145399841434, 6.270239916630294),(-6.270239916630294, 0.7593145399841422, 3.6201258997795907),(-6.270239916630294, -0.7593145399841478, 3.6201258997795907),(-7.244192640355521, -0.7593145399841482, 0.0)]) cmds.rename('neck_ctrl') cmds.group(n='neck_ctrl_grp') parentConForPos = [('neck_setup','neck_01_jnt'),('head_setup','head_jnt'),('neck_setup','neck_ctrl_grp'),('head_setup','head_ctrl_grp')] for each in parentConForPos: forDel = cmds.parentConstraint(each[0],each[1],mo=False) cmds.delete(forDel) pointneckjnt = cmds.pointConstraint('neck_01_jnt','neck_02_jnt',mo = False) cmds.pointConstraint('head_setup','neck_02_jnt',mo = False) orientneckjnt = cmds.orientConstraint('neck_setup','neck_02_jnt',mo = False) cmds.delete(pointneckjnt) cmds.delete(orientneckjnt) toParent = [('neck_01_jnt','spine_03_bln_jnt'),('head_ctrl_grp','neck_ctrl')] for each in toParent: cmds.parent(each[0],each[1]) cmds.parentConstraint('spine_03_bln_jnt','neck_ctrl_grp',mo=True) cmds.makeIdentity('neck_01_jnt', apply=True, rotate=True ) toParentCon = [('neck_ctrl','neck_01_jnt'),('head_ctrl','head_jnt')] for each in toParentCon: cmds.parentConstraint(each[0],each[1],mo = False) cmds.shadingNode('multiplyDivide',n = 'neck_mult',asUtility=1) toSetAttr = [('neck_mult.operation'),('neck_mult.input2X')] for each in toSetAttr: cmds.setAttr(each,2) toConnectAttr = [('head_ctrl.rotateY','neck_mult.input1X'),('neck_mult.outputX','neck_02_jnt.rotateY')] for each in toConnectAttr: cmds.connectAttr(each[0],each[1]) toSetControllerAttr = [('neck_ctrl'),('head_ctrl')] for each in toSetControllerAttr: cmds.setAttr (each+'.visibility',keyable = False, cb = False, lock = True) cmds.setAttr (each+'.scaleX',keyable = False, cb = False, lock = True) cmds.setAttr (each+'.scaleY',keyable = False, cb = False, lock = True) cmds.setAttr (each+'.scaleZ',keyable = False, cb = False, lock = True) cmds.setAttr (each+'.overrideEnabled' ,True) cmds.setAttr (each+'.overrideColor' ,17) # the command to change the progress bar cmds.progressBar('EugenesProgressBar', edit=True, step=1) neckSetup() def eyeAimSetup(): cmds.curve(d=1,p=[(10, -4, 0),(10, 4, 0),(-10, 4, 0),(-10, -4, 0),(10, -4, 0)]) cmds.rename('eye_aim_ctrl') cmds.group(n='eye_aim_ctrl_grp') forDel = cmds.pointConstraint('eye_aim_setup','eye_aim_ctrl_grp') cmds.delete(forDel) cmds.setAttr ('eye_aim_ctrl'+'.visibility',keyable = False, cb = False, lock = True) cmds.setAttr ('eye_aim_ctrl'+'.rotateX',keyable = False, cb = False, lock = True) cmds.setAttr ('eye_aim_ctrl'+'.rotateY',keyable = False, cb = False, lock = True) cmds.setAttr ('eye_aim_ctrl'+'.rotateZ',keyable = False, cb = False, lock = True) cmds.setAttr ('eye_aim_ctrl'+'.scaleX',keyable = False, cb = False, lock = True) cmds.setAttr ('eye_aim_ctrl'+'.scaleY',keyable = False, cb = False, lock = True) cmds.setAttr ('eye_aim_ctrl'+'.scaleZ',keyable = False, cb = False, lock = True) cmds.setAttr ('eye_aim_ctrl'+'.overrideEnabled' ,True) cmds.setAttr ('eye_aim_ctrl'+'.overrideColor' ,18) cmds.addAttr ('eye_aim_ctrl', at = 'enum', keyable=True, en = 'string1:string2:', ln='follow') cmds.addAttr ('eye_aim_ctrl'+'.follow', e=True, en = 'world:head:') cmds.parentConstraint('head_ctrl','eye_aim_ctrl_grp',mo = True) cmds.connectAttr('eye_aim_ctrl.follow','eye_aim_ctrl_grp_parentConstraint1.head_ctrlW0') cmds.parent('eye_aim_ctrl_grp','world_ctrl') eyeAimSetup() def eyeSetup(side): list = [('%s_eye_aim_ctrl'%(side),'%s_eye_aim_ctrl_grp'%(side))] for each in list: cmds.curve(d=1,p=[(2.5, 0, 0),(2.5, 1, 0),(1, 2.5, 0),(-1, 2.5, 0),(-2.5, 1, 0),(-2.5, -1, 0),(-1, -2.5, 0),(1, -2.5, 0),(2.5, -1, 0),(2.5, 0, 0)]) cmds.rename(each[0]) cmds.group(n=each[1]) cmds.setAttr (each[0]+'.visibility',keyable = False, cb = False, lock = True) cmds.setAttr (each[0]+'.rotateX',keyable = False, cb = False, lock = True) cmds.setAttr (each[0]+'.rotateY',keyable = False, cb = False, lock = True) cmds.setAttr (each[0]+'.rotateZ',keyable = False, cb = False, lock = True) cmds.setAttr (each[0]+'.scaleX',keyable = False, cb = False, lock = True) cmds.setAttr (each[0]+'.scaleY',keyable = False, cb = False, lock = True) cmds.setAttr (each[0]+'.scaleZ',keyable = False, cb = False, lock = True) cmds.setAttr (each[0]+'.overrideEnabled' ,True) cmds.setAttr (each[0]+'.overrideColor' ,18) list = [('%s_eye_setup'%(side),'%s_eye_aim_ctrl_grp'%(side))] for each in list: forDel = cmds.pointConstraint(each[0],each[1],mo=False) cmds.delete(forDel) list = [('%s_eye_aim_ctrl_grp'%(side),'eye_aim_ctrl')] for each in list: cmds.parent(each[0],each[1]) cmds.setAttr('%s_eye_aim_ctrl_grp.translateZ'%(side),0) cmds.joint(n='%s_eye_aim_jnt'%(side)) cmds.parent(w = True) cmds.spaceLocator(n='%s_eye_aim_up_loc'%(side)) cmds.group(n='%s_eye_aim_up_loc_grp'%(side)) list = [('%s_eye_setup'%(side),'%s_eye_aim_jnt'%(side)),('%s_eye_setup'%(side),'%s_eye_aim_up_loc_grp'%(side))] for each in list: forDel = cmds.parentConstraint(each[0],each[1],mo = False) cmds.delete(forDel) cmds.setAttr('%s_eye_aim_up_loc.translateY'%(side),10) cmds.parentConstraint('head_ctrl','%s_eye_aim_up_loc_grp'%(side),mo = True) cmds.aimConstraint('%s_eye_aim_ctrl'%(side),'%s_eye_aim_jnt'%(side),wut = 'object',wuo = '%s_eye_aim_up_loc'%(side),mo = True) cmds.parent('%s_eye_aim_jnt'%(side),'head_jnt') eyeSetup('l') eyeSetup('r') def buildSpineSkinJoint(): nameofJoint = [('spine_01_bind_jnt'),('spine_02_bind_jnt'),('spine_03_bind_jnt'),('neck_01_bind_jnt'),('neck_02_bind_jnt'),('head_bind_jnt'),('l_eye_aim_bind_jnt'),('r_eye_aim_bind_jnt')] for each in nameofJoint: cmds.joint(n=each) cmds.parent('r_eye_aim_bind_jnt','head_bind_jnt') #parentConSpineJointForPosition# parentConSpineJntForPos = [('spine_01_bln_jnt','spine_01_bind_jnt')],[('spine_02_bln_jnt','spine_02_bind_jnt')],[('spine_03_bln_jnt','spine_03_bind_jnt')],[('neck_01_jnt','neck_01_bind_jnt')],[('neck_02_jnt','neck_02_bind_jnt')],[('head_jnt','head_bind_jnt'),('l_eye_aim_jnt','l_eye_aim_bind_jnt'),('r_eye_aim_jnt','r_eye_aim_bind_jnt')] for each in parentConSpineJntForPos: for item in each: parentConSpineForDel = cmds.parentConstraint(item[0],item[1],mo = False) cmds.delete(parentConSpineForDel) cmds.makeIdentity( 'spine_01_bind_jnt', apply=True, translate=True, rotate=True ) #parentRigJoint# parentSpineConJnt = [('spine_01_bln_jnt','spine_01_bind_jnt')],[('spine_02_bln_jnt','spine_02_bind_jnt')],[('spine_03_bln_jnt','spine_03_bind_jnt')],[('neck_01_jnt','neck_01_bind_jnt')],[('neck_02_jnt','neck_02_bind_jnt')],[('head_jnt','head_bind_jnt'),('l_eye_aim_jnt','l_eye_aim_bind_jnt'),('r_eye_aim_jnt','r_eye_aim_bind_jnt')] for each in parentSpineConJnt: for item in each: cmds.parentConstraint(item[0],item[1],mo = True) cmds.scaleConstraint(item[0],item[1],mo = True) buildSpineSkinJoint() def bendyArmSkinJnt(): def buildLeftRightSkinJointArm(side): nameOfJnt = [('%s_shoulder_bind_jnt'%(side)),('%s_upper_arm_01_bind_jnt'%(side)),('%s_upper_arm_02_bind_jnt'%(side)),('%s_upper_arm_03_bind_jnt'%(side)),('%s_upper_arm_04_bind_jnt'%(side)),('%s_lower_arm_01_bind_jnt'%(side)),('%s_lower_arm_02_bind_jnt'%(side)),('%s_lower_arm_03_bind_jnt'%(side)),('%s_lower_arm_04_bind_jnt'%(side)),('%s_lower_arm_05_bind_jnt'%(side)),('%s_wrist_bind_jnt'%(side)),('%s_thumb_01_bind_jnt'%(side)),('%s_thumb_02_bind_jnt'%(side)),('%s_thumb_03_bind_jnt'%(side)),('%s_index_01_bind_jnt'%(side)),('%s_index_02_bind_jnt'%(side)),('%s_index_03_bind_jnt'%(side)),('%s_index_04_bind_jnt'%(side)),('%s_middle_01_bind_jnt'%(side)),('%s_middle_02_bind_jnt'%(side)),('%s_middle_03_bind_jnt'%(side)),('%s_middle_04_bind_jnt'%(side)),('%s_ring_01_bind_jnt'%(side)),('%s_ring_02_bind_jnt'%(side)),('%s_ring_03_bind_jnt'%(side)),('%s_ring_04_bind_jnt'%(side)),('%s_pinky_01_bind_jnt'%(side)),('%s_pinky_02_bind_jnt'%(side)),('%s_pinky_03_bind_jnt'%(side)),('%s_pinky_04_bind_jnt'%(side))] for each in nameOfJnt: cmds.joint(n=each) cmds.parent('%s_shoulder_bind_jnt'%(side),'spine_03_bind_jnt') cmds.parent('%s_index_01_bind_jnt'%(side),'%s_wrist_bind_jnt'%(side)) cmds.parent('%s_middle_01_bind_jnt'%(side),'%s_wrist_bind_jnt'%(side)) cmds.parent('%s_ring_01_bind_jnt'%(side),'%s_wrist_bind_jnt'%(side)) cmds.parent('%s_pinky_01_bind_jnt'%(side),'%s_wrist_bind_jnt'%(side)) #parentConJointForPosition# parentConlrJntForPos = [('%s_shoulder_jnt'%(side),'%s_shoulder_bind_jnt'%(side))],[('%s_upr_bendy_arm_01_jnt'%(side),'%s_upper_arm_01_bind_jnt'%(side))],[('%s_upr_bendy_arm_02_jnt'%(side),'%s_upper_arm_02_bind_jnt'%(side))],[('%s_upr_bendy_arm_03_jnt'%(side),'%s_upper_arm_03_bind_jnt'%(side))],[('%s_upr_bendy_arm_04_jnt'%(side),'%s_upper_arm_04_bind_jnt'%(side))],[('%s_lwr_bendy_arm_01_jnt'%(side),'%s_lower_arm_01_bind_jnt'%(side))],[('%s_lwr_bendy_arm_02_jnt'%(side),'%s_lower_arm_02_bind_jnt'%(side))],[('%s_lwr_bendy_arm_03_jnt'%(side),'%s_lower_arm_03_bind_jnt'%(side))],[('%s_lwr_bendy_arm_04_jnt'%(side),'%s_lower_arm_04_bind_jnt'%(side))],[('%s_lwr_bendy_arm_05_jnt'%(side),'%s_lower_arm_05_bind_jnt'%(side))],[('%s_arm_03_bln_jnt'%(side),'%s_wrist_bind_jnt'%(side))],[('%s_thumb_01_jnt'%(side),'%s_thumb_01_bind_jnt'%(side))],[('%s_thumb_02_jnt'%(side),'%s_thumb_02_bind_jnt'%(side))],[('%s_thumb_03_jnt'%(side),'%s_thumb_03_bind_jnt'%(side))],[('%s_index_01_jnt'%(side),'%s_index_01_bind_jnt'%(side))],[('%s_index_02_jnt'%(side),'%s_index_02_bind_jnt'%(side))],[('%s_index_03_jnt'%(side),'%s_index_03_bind_jnt'%(side))],[('%s_index_04_jnt'%(side),'%s_index_04_bind_jnt'%(side))],[('%s_middle_01_jnt'%(side),'%s_middle_01_bind_jnt'%(side))],[('%s_middle_02_jnt'%(side),'%s_middle_02_bind_jnt'%(side))],[('%s_middle_03_jnt'%(side),'%s_middle_03_bind_jnt'%(side))],[('%s_middle_04_jnt'%(side),'%s_middle_04_bind_jnt'%(side))],[('%s_ring_01_jnt'%(side),'%s_ring_01_bind_jnt'%(side))],[('%s_ring_02_jnt'%(side),'%s_ring_02_bind_jnt'%(side))],[('%s_ring_03_jnt'%(side),'%s_ring_03_bind_jnt'%(side))],[('%s_ring_04_jnt'%(side),'%s_ring_04_bind_jnt'%(side))],[('%s_pinky_01_jnt'%(side),'%s_pinky_01_bind_jnt'%(side))],[('%s_pinky_02_jnt'%(side),'%s_pinky_02_bind_jnt'%(side))],[('%s_pinky_03_jnt'%(side),'%s_pinky_03_bind_jnt'%(side))],[('%s_pinky_04_jnt'%(side),'%s_pinky_04_bind_jnt'%(side))] for each in parentConlrJntForPos: for item in each: parentConForDel = cmds.parentConstraint(item[0],item[1],mo = False) cmds.delete(parentConForDel) #freezeRigJoint# cmds.makeIdentity('%s_shoulder_bind_jnt'%(side),apply=True, translate=True, rotate=True) #parentRigJoint# parentlrConJnt = [('%s_shoulder_jnt'%(side),'%s_shoulder_bind_jnt'%(side))],[('%s_upr_bendy_arm_01_jnt'%(side),'%s_upper_arm_01_bind_jnt'%(side))],[('%s_upr_bendy_arm_02_jnt'%(side),'%s_upper_arm_02_bind_jnt'%(side))],[('%s_upr_bendy_arm_03_jnt'%(side),'%s_upper_arm_03_bind_jnt'%(side))],[('%s_upr_bendy_arm_04_jnt'%(side),'%s_upper_arm_04_bind_jnt'%(side))],[('%s_lwr_bendy_arm_01_jnt'%(side),'%s_lower_arm_01_bind_jnt'%(side))],[('%s_lwr_bendy_arm_02_jnt'%(side),'%s_lower_arm_02_bind_jnt'%(side))],[('%s_lwr_bendy_arm_03_jnt'%(side),'%s_lower_arm_03_bind_jnt'%(side))],[('%s_lwr_bendy_arm_04_jnt'%(side),'%s_lower_arm_04_bind_jnt'%(side))],[('%s_lwr_bendy_arm_05_jnt'%(side),'%s_lower_arm_05_bind_jnt'%(side))],[('%s_arm_03_bln_jnt'%(side),'%s_wrist_bind_jnt'%(side))],[('%s_thumb_01_jnt'%(side),'%s_thumb_01_bind_jnt'%(side))],[('%s_thumb_02_jnt'%(side),'%s_thumb_02_bind_jnt'%(side))],[('%s_thumb_03_jnt'%(side),'%s_thumb_03_bind_jnt'%(side))],[('%s_index_01_jnt'%(side),'%s_index_01_bind_jnt'%(side))],[('%s_index_02_jnt'%(side),'%s_index_02_bind_jnt'%(side))],[('%s_index_03_jnt'%(side),'%s_index_03_bind_jnt'%(side))],[('%s_index_04_jnt'%(side),'%s_index_04_bind_jnt'%(side))],[('%s_middle_01_jnt'%(side),'%s_middle_01_bind_jnt'%(side))],[('%s_middle_02_jnt'%(side),'%s_middle_02_bind_jnt'%(side))],[('%s_middle_03_jnt'%(side),'%s_middle_03_bind_jnt'%(side))],[('%s_middle_04_jnt'%(side),'%s_middle_04_bind_jnt'%(side))],[('%s_ring_01_jnt'%(side),'%s_ring_01_bind_jnt'%(side))],[('%s_ring_02_jnt'%(side),'%s_ring_02_bind_jnt'%(side))],[('%s_ring_03_jnt'%(side),'%s_ring_03_bind_jnt'%(side))],[('%s_ring_04_jnt'%(side),'%s_ring_04_bind_jnt'%(side))],[('%s_pinky_01_jnt'%(side),'%s_pinky_01_bind_jnt'%(side))],[('%s_pinky_02_jnt'%(side),'%s_pinky_02_bind_jnt'%(side))],[('%s_pinky_03_jnt'%(side),'%s_pinky_03_bind_jnt'%(side))],[('%s_pinky_04_jnt'%(side),'%s_pinky_04_bind_jnt'%(side))] for each in parentlrConJnt: for item in each: cmds.parentConstraint(item[0],item[1],mo = True) scalelrConJnt = [('world_ctrl','%s_shoulder_bind_jnt'%(side))],[('world_ctrl','%s_upper_arm_01_bind_jnt'%(side))],[('world_ctrl','%s_upper_arm_02_bind_jnt'%(side))],[('world_ctrl','%s_upper_arm_03_bind_jnt'%(side))],[('world_ctrl','%s_upper_arm_04_bind_jnt'%(side))],[('world_ctrl','%s_lower_arm_01_bind_jnt'%(side))],[('world_ctrl','%s_lower_arm_02_bind_jnt'%(side))],[('world_ctrl','%s_lower_arm_03_bind_jnt'%(side))],[('world_ctrl','%s_lower_arm_04_bind_jnt'%(side))],[('world_ctrl','%s_lower_arm_05_bind_jnt'%(side))],[('world_ctrl','%s_wrist_bind_jnt'%(side))],[('world_ctrl','%s_thumb_01_bind_jnt'%(side))],[('world_ctrl','%s_thumb_02_bind_jnt'%(side))],[('world_ctrl','%s_thumb_03_bind_jnt'%(side))],[('world_ctrl','%s_index_01_bind_jnt'%(side))],[('world_ctrl','%s_index_02_bind_jnt'%(side))],[('world_ctrl','%s_index_03_bind_jnt'%(side))],[('world_ctrl','%s_index_04_bind_jnt'%(side))],[('world_ctrl','%s_middle_01_bind_jnt'%(side))],[('world_ctrl','%s_middle_02_bind_jnt'%(side))],[('world_ctrl','%s_middle_03_bind_jnt'%(side))],[('world_ctrl','%s_middle_04_bind_jnt'%(side))],[('world_ctrl','%s_ring_01_bind_jnt'%(side))],[('world_ctrl','%s_ring_02_bind_jnt'%(side))],[('world_ctrl','%s_ring_03_bind_jnt'%(side))],[('world_ctrl','%s_ring_04_bind_jnt'%(side))],[('world_ctrl','%s_pinky_01_bind_jnt'%(side))],[('world_ctrl','%s_pinky_02_bind_jnt'%(side))],[('world_ctrl','%s_pinky_03_bind_jnt'%(side))],[('world_ctrl','%s_pinky_04_bind_jnt'%(side))] for each in scalelrConJnt: for item in each: cmds.scaleConstraint(item[0],item[1],mo = True) buildLeftRightSkinJointArm('l') buildLeftRightSkinJointArm('r') def noBendyArmSkinJnt(): def buildLeftRightSkinJointWithNoBendyArm(side): nameOfJnt = [('%s_shoulder_bind_jnt'%(side)),('%s_arm_01_bind_jnt'%(side)),('%s_arm_02_bind_jnt'%(side)),('%s_arm_03_bind_jnt'%(side)),('%s_thumb_01_bind_jnt'%(side)),('%s_thumb_02_bind_jnt'%(side)),('%s_thumb_03_bind_jnt'%(side)),('%s_index_01_bind_jnt'%(side)),('%s_index_02_bind_jnt'%(side)),('%s_index_03_bind_jnt'%(side)),('%s_index_04_bind_jnt'%(side)),('%s_middle_01_bind_jnt'%(side)),('%s_middle_02_bind_jnt'%(side)),('%s_middle_03_bind_jnt'%(side)),('%s_middle_04_bind_jnt'%(side)),('%s_ring_01_bind_jnt'%(side)),('%s_ring_02_bind_jnt'%(side)),('%s_ring_03_bind_jnt'%(side)),('%s_ring_04_bind_jnt'%(side)),('%s_pinky_01_bind_jnt'%(side)),('%s_pinky_02_bind_jnt'%(side)),('%s_pinky_03_bind_jnt'%(side)),('%s_pinky_04_bind_jnt'%(side))] for each in nameOfJnt: cmds.joint(n=each) cmds.parent('%s_shoulder_bind_jnt'%(side),'spine_03_bind_jnt') cmds.parent('%s_index_01_bind_jnt'%(side),'%s_arm_03_bind_jnt'%(side)) cmds.parent('%s_middle_01_bind_jnt'%(side),'%s_arm_03_bind_jnt'%(side)) cmds.parent('%s_ring_01_bind_jnt'%(side),'%s_arm_03_bind_jnt'%(side)) cmds.parent('%s_pinky_01_bind_jnt'%(side),'%s_arm_03_bind_jnt'%(side)) #parentConJointForPosition# parentConlrJntForPos = [('%s_shoulder_jnt'%(side),'%s_shoulder_bind_jnt'%(side))],[('%s_arm_01_bln_jnt'%(side),'%s_arm_01_bind_jnt'%(side))],[('%s_arm_02_bln_jnt'%(side),'%s_arm_02_bind_jnt'%(side))],[('%s_arm_03_bln_jnt'%(side),'%s_arm_03_bind_jnt'%(side))],[('%s_thumb_01_jnt'%(side),'%s_thumb_01_bind_jnt'%(side))],[('%s_thumb_02_jnt'%(side),'%s_thumb_02_bind_jnt'%(side))],[('%s_thumb_03_jnt'%(side),'%s_thumb_03_bind_jnt'%(side))],[('%s_index_01_jnt'%(side),'%s_index_01_bind_jnt'%(side))],[('%s_index_02_jnt'%(side),'%s_index_02_bind_jnt'%(side))],[('%s_index_03_jnt'%(side),'%s_index_03_bind_jnt'%(side))],[('%s_index_04_jnt'%(side),'%s_index_04_bind_jnt'%(side))],[('%s_middle_01_jnt'%(side),'%s_middle_01_bind_jnt'%(side))],[('%s_middle_02_jnt'%(side),'%s_middle_02_bind_jnt'%(side))],[('%s_middle_03_jnt'%(side),'%s_middle_03_bind_jnt'%(side))],[('%s_middle_04_jnt'%(side),'%s_middle_04_bind_jnt'%(side))],[('%s_ring_01_jnt'%(side),'%s_ring_01_bind_jnt'%(side))],[('%s_ring_02_jnt'%(side),'%s_ring_02_bind_jnt'%(side))],[('%s_ring_03_jnt'%(side),'%s_ring_03_bind_jnt'%(side))],[('%s_ring_04_jnt'%(side),'%s_ring_04_bind_jnt'%(side))],[('%s_pinky_01_jnt'%(side),'%s_pinky_01_bind_jnt'%(side))],[('%s_pinky_02_jnt'%(side),'%s_pinky_02_bind_jnt'%(side))],[('%s_pinky_03_jnt'%(side),'%s_pinky_03_bind_jnt'%(side))],[('%s_pinky_04_jnt'%(side),'%s_pinky_04_bind_jnt'%(side))] for each in parentConlrJntForPos: for item in each: parentConForDel = cmds.parentConstraint(item[0],item[1],mo = False) cmds.delete(parentConForDel) #freezeRigJoint# cmds.makeIdentity('%s_shoulder_bind_jnt'%(side),apply=True, translate=True, rotate=True) #parentRigJoint# parentlrConJnt = [('%s_shoulder_jnt'%(side),'%s_shoulder_bind_jnt'%(side))],[('%s_arm_01_bln_jnt'%(side),'%s_arm_01_bind_jnt'%(side))],[('%s_arm_02_bln_jnt'%(side),'%s_arm_02_bind_jnt'%(side))],[('%s_arm_03_bln_jnt'%(side),'%s_arm_03_bind_jnt'%(side))],[('%s_thumb_01_jnt'%(side),'%s_thumb_01_bind_jnt'%(side))],[('%s_thumb_02_jnt'%(side),'%s_thumb_02_bind_jnt'%(side))],[('%s_thumb_03_jnt'%(side),'%s_thumb_03_bind_jnt'%(side))],[('%s_index_01_jnt'%(side),'%s_index_01_bind_jnt'%(side))],[('%s_index_02_jnt'%(side),'%s_index_02_bind_jnt'%(side))],[('%s_index_03_jnt'%(side),'%s_index_03_bind_jnt'%(side))],[('%s_index_04_jnt'%(side),'%s_index_04_bind_jnt'%(side))],[('%s_middle_01_jnt'%(side),'%s_middle_01_bind_jnt'%(side))],[('%s_middle_02_jnt'%(side),'%s_middle_02_bind_jnt'%(side))],[('%s_middle_03_jnt'%(side),'%s_middle_03_bind_jnt'%(side))],[('%s_middle_04_jnt'%(side),'%s_middle_04_bind_jnt'%(side))],[('%s_ring_01_jnt'%(side),'%s_ring_01_bind_jnt'%(side))],[('%s_ring_02_jnt'%(side),'%s_ring_02_bind_jnt'%(side))],[('%s_ring_03_jnt'%(side),'%s_ring_03_bind_jnt'%(side))],[('%s_ring_04_jnt'%(side),'%s_ring_04_bind_jnt'%(side))],[('%s_pinky_01_jnt'%(side),'%s_pinky_01_bind_jnt'%(side))],[('%s_pinky_02_jnt'%(side),'%s_pinky_02_bind_jnt'%(side))],[('%s_pinky_03_jnt'%(side),'%s_pinky_03_bind_jnt'%(side))],[('%s_pinky_04_jnt'%(side),'%s_pinky_04_bind_jnt'%(side))] for each in parentlrConJnt: for item in each: cmds.parentConstraint(item[0],item[1],mo = True) scalelrConJnt = [('world_ctrl','%s_shoulder_bind_jnt'%(side))],[('world_ctrl','%s_arm_01_bind_jnt'%(side))],[('world_ctrl','%s_arm_02_bind_jnt'%(side))],[('world_ctrl','%s_arm_03_bind_jnt'%(side))],[('world_ctrl','%s_thumb_01_bind_jnt'%(side))],[('world_ctrl','%s_thumb_02_bind_jnt'%(side))],[('world_ctrl','%s_thumb_03_bind_jnt'%(side))],[('world_ctrl','%s_index_01_bind_jnt'%(side))],[('world_ctrl','%s_index_02_bind_jnt'%(side))],[('world_ctrl','%s_index_03_bind_jnt'%(side))],[('world_ctrl','%s_index_04_bind_jnt'%(side))],[('world_ctrl','%s_middle_01_bind_jnt'%(side))],[('world_ctrl','%s_middle_02_bind_jnt'%(side))],[('world_ctrl','%s_middle_03_bind_jnt'%(side))],[('world_ctrl','%s_middle_04_bind_jnt'%(side))],[('world_ctrl','%s_ring_01_bind_jnt'%(side))],[('world_ctrl','%s_ring_02_bind_jnt'%(side))],[('world_ctrl','%s_ring_03_bind_jnt'%(side))],[('world_ctrl','%s_ring_04_bind_jnt'%(side))],[('world_ctrl','%s_pinky_01_bind_jnt'%(side))],[('world_ctrl','%s_pinky_02_bind_jnt'%(side))],[('world_ctrl','%s_pinky_03_bind_jnt'%(side))],[('world_ctrl','%s_pinky_04_bind_jnt'%(side))] for each in scalelrConJnt: for item in each: cmds.scaleConstraint(item[0],item[1],mo = True) buildLeftRightSkinJointWithNoBendyArm('l') buildLeftRightSkinJointWithNoBendyArm('r') bendyArmlabel = cmds.checkBox('bendyArm', q=1,label=1) bendyArmlabel = cmds.checkBox('bendyArm', q=1,v=1 ) if bendyArmlabel == 1: print(bendyArmSkinJnt()) elif bendyArmlabel == 0: print(noBendyArmSkinJnt()) def bendyLegSkinJnt(): def buildLeftRightLegSkinJoint(side): nameOfJnt = [('%s_upr_leg_01_bind_jnt'%(side)),('%s_upr_leg_02_bind_jnt'%(side)),('%s_upr_leg_03_bind_jnt'%(side)),('%s_upr_leg_04_bind_jnt'%(side)),('%s_lwr_leg_01_bind_jnt'%(side)),('%s_lwr_leg_02_bind_jnt'%(side)),('%s_lwr_leg_03_bind_jnt'%(side)),('%s_lwr_leg_04_bind_jnt'%(side)),('%s_ankle_bind_jnt'%(side)),('%s_leg_ball_bind_jnt'%(side))] for each in nameOfJnt: cmds.joint(n=each) cmds.parent('%s_upr_leg_01_bind_jnt'%(side),'spine_01_bind_jnt') #parentConJointForPosition# parentConlrJntForPos = [('%s_upr_bendy_leg_01_jnt'%(side),'%s_upr_leg_01_bind_jnt'%(side))],[('%s_upr_bendy_leg_02_jnt'%(side),'%s_upr_leg_02_bind_jnt'%(side))],[('%s_upr_bendy_leg_03_jnt'%(side),'%s_upr_leg_03_bind_jnt'%(side))],[('%s_upr_bendy_leg_04_jnt'%(side),'%s_upr_leg_04_bind_jnt'%(side))],[('%s_lwr_bendy_leg_01_jnt'%(side),'%s_lwr_leg_01_bind_jnt'%(side))],[('%s_lwr_bendy_leg_02_jnt'%(side),'%s_lwr_leg_02_bind_jnt'%(side))],[('%s_lwr_bendy_leg_03_jnt'%(side),'%s_lwr_leg_03_bind_jnt'%(side))],[('%s_lwr_bendy_leg_04_jnt'%(side),'%s_lwr_leg_04_bind_jnt'%(side))],[('%s_leg_03_bln_jnt'%(side),'%s_ankle_bind_jnt'%(side))],[('%s_leg_04_bln_jnt'%(side),'%s_leg_ball_bind_jnt'%(side))] for each in parentConlrJntForPos: for item in each: parentConForDel = cmds.parentConstraint(item[0],item[1],mo = False) cmds.delete(parentConForDel) #freezeRigJoint# cmds.makeIdentity('%s_upr_leg_01_bind_jnt'%(side),apply=True, translate=True, rotate=True) #parentRigJoint# parentlrConJnt = [('%s_upr_bendy_leg_01_jnt'%(side),'%s_upr_leg_01_bind_jnt'%(side))],[('%s_upr_bendy_leg_02_jnt'%(side),'%s_upr_leg_02_bind_jnt'%(side))],[('%s_upr_bendy_leg_03_jnt'%(side),'%s_upr_leg_03_bind_jnt'%(side))],[('%s_upr_bendy_leg_04_jnt'%(side),'%s_upr_leg_04_bind_jnt'%(side))],[('%s_lwr_bendy_leg_01_jnt'%(side),'%s_lwr_leg_01_bind_jnt'%(side))],[('%s_lwr_bendy_leg_02_jnt'%(side),'%s_lwr_leg_02_bind_jnt'%(side))],[('%s_lwr_bendy_leg_03_jnt'%(side),'%s_lwr_leg_03_bind_jnt'%(side))],[('%s_lwr_bendy_leg_04_jnt'%(side),'%s_lwr_leg_04_bind_jnt'%(side))],[('%s_leg_03_bln_jnt'%(side),'%s_ankle_bind_jnt'%(side))],[('%s_leg_04_bln_jnt'%(side),'%s_leg_ball_bind_jnt'%(side))] for each in parentlrConJnt: for item in each: cmds.parentConstraint(item[0],item[1],mo = True) parentlrConJnt = [('world_ctrl','%s_upr_leg_01_bind_jnt'%(side))],[('world_ctrl','%s_upr_leg_02_bind_jnt'%(side))],[('world_ctrl','%s_upr_leg_03_bind_jnt'%(side))],[('world_ctrl','%s_upr_leg_04_bind_jnt'%(side))],[('world_ctrl','%s_lwr_leg_01_bind_jnt'%(side))],[('world_ctrl','%s_lwr_leg_02_bind_jnt'%(side))],[('world_ctrl','%s_lwr_leg_03_bind_jnt'%(side))],[('world_ctrl','%s_lwr_leg_04_bind_jnt'%(side))],[('world_ctrl','%s_ankle_bind_jnt'%(side))],[('world_ctrl','%s_leg_ball_bind_jnt'%(side))] for each in parentlrConJnt: for item in each: cmds.scaleConstraint(item[0],item[1],mo = True) buildLeftRightLegSkinJoint('l') buildLeftRightLegSkinJoint('r') def noBendyLegSkinJnt(): def buildLeftRightSkinJointWithNoBendyLeg(side): nameOfJnt = [('%s_leg_01_bind_jnt'%(side)),('%s_leg_02_bind_jnt'%(side)),('%s_leg_03_bind_jnt'%(side)),('%s_leg_04_bind_jnt'%(side))] for each in nameOfJnt: cmds.joint(n=each) cmds.parent('%s_leg_01_bind_jnt'%(side),'spine_01_bind_jnt') #parentConJointForPosition# parentConlrJntForPos = [('%s_leg_01_bln_jnt'%(side),'%s_leg_01_bind_jnt'%(side))],[('%s_leg_02_bln_jnt'%(side),'%s_leg_02_bind_jnt'%(side))],[('%s_leg_03_bln_jnt'%(side),'%s_leg_03_bind_jnt'%(side))],[('%s_leg_04_bln_jnt'%(side),'%s_leg_04_bind_jnt'%(side))] for each in parentConlrJntForPos: for item in each: parentConForDel = cmds.parentConstraint(item[0],item[1],mo = False) cmds.delete(parentConForDel) #freezeRigJoint# cmds.makeIdentity('%s_leg_01_bind_jnt'%(side),apply=True, translate=True, rotate=True) #parentRigJoint# parentlrConJnt = [('%s_leg_01_bln_jnt'%(side),'%s_leg_01_bind_jnt'%(side))],[('%s_leg_02_bln_jnt'%(side),'%s_leg_02_bind_jnt'%(side))],[('%s_leg_03_bln_jnt'%(side),'%s_leg_03_bind_jnt'%(side))],[('%s_leg_04_bln_jnt'%(side),'%s_leg_04_bind_jnt'%(side))] for each in parentlrConJnt: for item in each: cmds.parentConstraint(item[0],item[1],mo = True) parentlrConJnt = [('world_ctrl','%s_leg_01_bind_jnt'%(side))],[('world_ctrl','%s_leg_02_bind_jnt'%(side))],[('world_ctrl','%s_leg_03_bind_jnt'%(side))],[('world_ctrl','%s_leg_04_bind_jnt'%(side))] for each in parentlrConJnt: for item in each: cmds.scaleConstraint(item[0],item[1],mo = True) buildLeftRightSkinJointWithNoBendyLeg('l') buildLeftRightSkinJointWithNoBendyLeg('r') bendyLeglabel = cmds.checkBox('bendyLeg', q=1,label=1) bendyLeglabel = cmds.checkBox('bendyLeg', q=1,v=1 ) if bendyLeglabel == 1: print(bendyLegSkinJnt()) elif bendyLeglabel == 0: print(noBendyLegSkinJnt()) def groupAll(): createGroup = [('extra'),('rename'),('mesh_grp')] for each in createGroup: cmds.group(n=each,em=True) cmds.setAttr('extra.visibility',0) cmds.setAttr('world_setup.visibility',0) cmds.setAttr('jnt_grp.visibility',0) list = ['leg_bendy_setup_grp','l_upr_leg_bendy_jnt_grp','arm_bendy_setup_grp','r_upr_leg_bendy_jnt_grp','l_lwr_leg_bendy_jnt_grp','r_lwr_leg_bendy_jnt_grp','l_eye_aim_up_loc_grp','r_eye_aim_up_loc_grp'] for each in list: if cmds.objExists(each): cmds.parent(each,'extra') else: print('') parentgrp = [('arm_jnt_grp','jnt_grp'),('spine_jnt_grp','jnt_grp'),('leg_jnt_grp','jnt_grp'),('r_fk_arm_01_ctrl_grp','world_ctrl'),('l_fk_arm_01_ctrl_grp','world_ctrl'),('neck_ctrl_grp','world_ctrl'),('spine_01_FK_ctrl_grp','world_ctrl'),('cog_ctrl_grp','world_ctrl'),('world_setup','rename'),('main_ctrl_grp','rename'),('jnt_grp','rename'),('mesh_grp','rename'),('spine_01_bind_jnt','rename'),('extra','rename'),('spine_IK_setup_grp','extra'),('spine_IK_ctrl_grp','world_ctrl'),('l_elbow_direction_crv_grp','main_ctrl_grp'),('r_elbow_direction_crv_grp','main_ctrl_grp'),('l_knee_direction_crv_grp','main_ctrl_grp'),('r_knee_direction_crv_grp','main_ctrl_grp')] for each in parentgrp: cmds.parent(each[0],each[1]) parentgroup = cmds.ls('l_elbow_loc_grp','l_upr_arm_bendy_jnt_grp','l_lwr_arm_bendy_jnt_grp','l_arm_start_dist_loc_grp','r_elbow_loc_grp','r_upr_arm_bendy_jnt_grp','r_lwr_arm_bendy_jnt_grp','r_arm_start_dist_loc_grp','l_knee_loc_grp','l_foot_ikHandle_grp','l_leg_start_dist_loc_grp','r_knee_loc_grp','r_foot_ikHandle_grp','r_leg_start_dist_loc_grp') for each in parentgroup: cmds.parent(each,'extra') # the command to change the progress bar cmds.progressBar('EugenesProgressBar', edit=True, step=1) groupAll() def progressBarWindowClose(): # the command to close the progress bar cmds.deleteUI('EugenesProgress',window=True) progressBarWindowClose() upper_lid_vertex_ids = [] lower_lid_vertex_ids = [] joint_prefix = "eyelid_joint" center_locator = "eye_display_loc" def create_display_eye(): selected_objects = cmds.ls(selection=True) cmds.spaceLocator(n='eye_display_loc') cmds.polySphere(n='eye_display') cmds.parent('eye_display','eye_display_loc') list = [('eye_display' , '.scaleX'),('eye_display' , '.scaleY'),('eye_display' , '.scaleZ')] for each in list: cmds.setAttr(each[0] + each[1],0.75) cmds.spaceLocator(n='eye_aim_up_loc') cmds.parent('eye_aim_up_loc','eye_display_loc') cmds.setAttr('eye_aim_up_loc.translateY',2) cmds.setAttr('eye_aim_up_loc.visibility',0) obj_center = cmds.xform(selected_objects, query=True, translation=True, worldSpace=True) cmds.xform(selected_objects, translation=obj_center, worldSpace=True) locator_translation = cmds.xform('eye_display_loc', query=True, translation=True, worldSpace=True) if all(value == 0 for value in locator_translation): forDel = cmds.parentConstraint(selected_objects, 'eye_display_loc', mo=False) cmds.delete(forDel) list = [('eye_aim_up_loc.scaleZ'),('eye_aim_up_loc.scaleY'),('eye_aim_up_loc.scaleX'),('eye_aim_up_loc.rotateZ'),('eye_aim_up_loc.rotateY'),('eye_aim_up_loc.rotateX'),('eye_aim_up_loc.translateZ'),('eye_aim_up_loc.translateY'),('eye_aim_up_loc.translateX'),('eye_aim_up_loc.visibility'),('eye_display.visibility'),('eye_display.translateX'),('eye_display.translateY'),('eye_display.translateZ'),('eye_display.rotateX'),('eye_display.rotateY'),('eye_display.rotateZ'),('eye_display.scaleX'),('eye_display.scaleY'),('eye_display.scaleZ')] for each in list: cmds.setAttr(each,keyable = False, cb = False, lock = True) def store_vertex_ids(): global upper_lid_vertex_ids upper_lid_vertex_ids = cmds.ls(selection=True, flatten=True) #cmds.textScrollList(upperLidList, edit=True, removeAll=True) #cmds.textScrollList(upperLidList, edit=True, append=upper_lid_vertex_ids) edge_list = cmds.polyListComponentConversion(upper_lid_vertex_ids, fromVertex=True, toEdge=True) sel = cmds.select(edge_list) mel.eval('PolySelectTraverse 2;') curve = cmds.polyToCurve(form=2, degree=1, ch=0, n="upper_lid_crv") def store_lower_vertex_ids(): global lower_lid_vertex_ids lower_lid_vertex_ids = cmds.ls(selection=True, flatten=True) #cmds.textScrollList(lowerLidList, edit=True, removeAll=True) #cmds.textScrollList(lowerLidList, edit=True, append=lower_lid_vertex_ids) edge_list = cmds.polyListComponentConversion(lower_lid_vertex_ids, fromVertex=True, toEdge=True) sel = cmds.select(edge_list) mel.eval('PolySelectTraverse 2;') curve = cmds.polyToCurve(form=2, degree=1, ch=0, n="Lower_lid_crv") def create_joints_and_parent_joints(*args): create_joints() create_parent_joints() def create_joints(*args): global upper_lid_vertex_ids, lower_lid_vertex_ids, joint_prefix for i, vertex_id in enumerate(upper_lid_vertex_ids): pos = cmds.pointPosition(vertex_id, w=True) joint_name = "{0}_upper_{1}".format(joint_prefix, i+1) jntUpperLids = cmds.joint(p=pos, n=joint_name) loc = cmds.spaceLocator(n='upperLidLoc_1') pos = cmds.xform(jntUpperLids, q = True, ws = True, t = True) cmds.xform(loc, ws = True, t= pos) for i, vertex_id in enumerate(lower_lid_vertex_ids): pos = cmds.pointPosition(vertex_id, w=True) joint_name = "{0}_lower_{1}".format(joint_prefix, i+1) jntLowerLids = cmds.joint(p=pos, n=joint_name) loc = cmds.spaceLocator(n='lowerLidLoc_1') pos = cmds.xform(jntLowerLids, q = True, ws = True, t = True) cmds.xform(loc, ws = True, t= pos) def create_parent_joints(*args): eyelidcrvrev = cmds.checkBox('reversecrv', q=1,label=1) eyelidcrvrev = cmds.checkBox('reversecrv', q=1,v=1 ) if eyelidcrvrev == 1: cmds.reverseCurve('Lower_lid_crv') global joint_prefix, center_locator center_loc_position = cmds.pointPosition(center_locator, w=True) for i in range(len(upper_lid_vertex_ids)): joint_name = "{0}_upper_{1}".format(joint_prefix, i+1) parent_joint_name = "{0}_upper_parent_{1}".format(joint_prefix, i+1) cmds.select(clear=True) jntUpperLid = cmds.joint(p=center_loc_position, n=parent_joint_name) cmds.parent(joint_name, parent_joint_name) cmds.joint(jntUpperLid, e = True, oj = 'xyz' , sao = 'yup', ch = 1 , zso = True) for i in range(len(lower_lid_vertex_ids)): joint_name = "{0}_lower_{1}".format(joint_prefix, i+1) parent_joint_name = "{0}_lower_parent_{1}".format(joint_prefix, i+1) cmds.select(clear=True) jntLowerLid = cmds.joint(p=center_loc_position, n=parent_joint_name) cmds.parent(joint_name, parent_joint_name) cmds.joint(jntLowerLid, e = True, oj = 'xyz' , sao = 'yup', ch = 1 , zso = True) old_upper_prefix = "Lower_lid_crv_jnt_upper_parent_" new_upper_prefix = "eyelid_joint_upper_parent_" for i in range(1, 1000): old_joint_name = f"{old_upper_prefix}{i}" new_joint_name = f"{new_upper_prefix}{i}" if cmds.objExists(old_joint_name): cmds.rename(old_joint_name, new_joint_name) old_lower_prefix = "Lower_lid_crv_jnt_lower_parent_" new_lower_prefix = "eyelid_joint_lower_parent_" for i in range(1, 1000): old_lower_joint_name = f"{old_lower_prefix}{i}" new_lower_joint_name = f"{new_lower_prefix}{i}" if cmds.objExists(old_lower_joint_name): cmds.rename(old_lower_joint_name, new_lower_joint_name) old_upper_child_prefix = "Lower_lid_crv_jnt_upper_" new_upper_child_prefix = "eyelid_joint_upper_" for i in range(1, 1000): old_upper_child_joint_name = f"{old_upper_child_prefix}{i}" new_upper_child_joint_name = f"{new_upper_child_prefix}{i}" if cmds.objExists(old_upper_child_joint_name): cmds.rename(old_upper_child_joint_name, new_upper_child_joint_name) old_lower_child_prefix = "Lower_lid_crv_jnt_lower_" new_lower_child_prefix = "eyelid_joint_lower_" for i in range(1, 1000): old_lower_child_joint_name = f"{old_lower_child_prefix}{i}" new_lower_child_joint_name = f"{new_lower_child_prefix}{i}" if cmds.objExists(old_lower_child_joint_name): cmds.rename(old_lower_child_joint_name, new_lower_child_joint_name) source_prefix = "eyelid_joint_upper_parent_" target_prefix = "upperLidLoc_" source_objects = cmds.ls(source_prefix + "*", type="transform") target_objects = cmds.ls(target_prefix + "*", type="transform")
Sat Sep 14 2024 11:18:38 GMT+0000 (Coordinated Universal Time) https://olp.hou.edu.vn/contest/tet2024
Fri Sep 13 2024 16:28:04 GMT+0000 (Coordinated Universal Time) https://docs.djangoproject.com/fr/5.1/intro/tutorial02/
Fri Sep 13 2024 15:26:46 GMT+0000 (Coordinated Universal Time) https://docs.djangoproject.com/fr/5.1/intro/tutorial01/
Fri Sep 13 2024 15:26:19 GMT+0000 (Coordinated Universal Time) https://docs.djangoproject.com/fr/5.1/intro/tutorial01/
Fri Sep 13 2024 14:03:02 GMT+0000 (Coordinated Universal Time) https://appticz.com/doordash-clone
Fri Sep 13 2024 13:33:33 GMT+0000 (Coordinated Universal Time) https://sqlfiddle.com/mysql/online-compiler?id=d6bf30f4-ccd9-4b1d-bff1-80b81e3f85e8
Fri Sep 13 2024 06:56:11 GMT+0000 (Coordinated Universal Time) https://vn.spoj.com/problems/STABLE/
Fri Sep 13 2024 06:55:57 GMT+0000 (Coordinated Universal Time) https://vn.spoj.com/problems/CHESSCBG/
Fri Sep 13 2024 06:55:33 GMT+0000 (Coordinated Universal Time) https://vietcodes.github.io/code/48/
Fri Sep 13 2024 05:54:17 GMT+0000 (Coordinated Universal Time) https://goodvibesonly.cloud/category/tutorials-in-hindi/fortran-tutorial-in-hindi/
Fri Sep 13 2024 05:15:55 GMT+0000 (Coordinated Universal Time) https://appticz.com/cryptocurrency-wallet-development
Thu Sep 12 2024 23:59:53 GMT+0000 (Coordinated Universal Time) https://www.clackamas.us/node/182601/edit
Thu Sep 12 2024 23:54:13 GMT+0000 (Coordinated Universal Time) https://www.clackamas.us/node/182146/edit
Thu Sep 12 2024 23:51:09 GMT+0000 (Coordinated Universal Time) https://www.clackamas.us/node/182606/edit
Thu Sep 12 2024 22:20:26 GMT+0000 (Coordinated Universal Time) https://web1.clackamas.us/web-cheat-sheet
Thu Sep 12 2024 17:20:36 GMT+0000 (Coordinated Universal Time) https://docs.wortise.com/v/en/android-sdk/sdk-integration
Thu Sep 12 2024 14:31:48 GMT+0000 (Coordinated Universal Time)
@Y@sir #automatefaqsschema #bricksaccordionelement #automatefaqsschema for bricks accordion element
Thu Sep 12 2024 12:48:13 GMT+0000 (Coordinated Universal Time) https://creatiosoft.com/poker-game-development
Thu Sep 12 2024 10:01:27 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/hire-blockchain-developers/
@AaronMG ##hireblockchaindevelopers ##hiringblockchaindevelopers ##bestblockchaindevelopers
Thu Sep 12 2024 08:06:31 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/top-nft-trends/
@LilianAnderson #topnfttrends #nfttrends #nftdevelopment #nftsolutions #tokenization